Commit 622d62ea authored by Volker Krause's avatar Volker Krause
Browse files

Clean up collection mode API a bit

parent 83356c40
......@@ -148,7 +148,7 @@ private slots:
Provider p;
auto src = new StartCountSource;
QVERIFY(!src->description().isEmpty());
p.addDataSource(src, Provider::AllStatistics);
p.addDataSource(src, Provider::DetailedUsageStatistics);
const auto m = src->data().toMap();
QVERIFY(m.contains(QLatin1String("value")));
QVERIFY(m.value(QLatin1String("value")).toInt() >= 1);
......@@ -159,7 +159,7 @@ private slots:
Provider p;
auto src = new UsageTimeSource;
QVERIFY(!src->description().isEmpty());
p.addDataSource(src, Provider::AllStatistics);
p.addDataSource(src, Provider::DetailedUsageStatistics);
QTest::qWait(1200);
const auto m = src->data().toMap();
QVERIFY(m.contains(QLatin1String("value")));
......
......@@ -91,11 +91,11 @@ private slots:
// submit data
Provider provider;
provider.setStatisticsCollectionMode(Provider::AllStatistics);
provider.setStatisticsCollectionMode(Provider::DetailedUsageStatistics);
provider.setProductIdentifier(QStringLiteral("org.kde.UserFeedback.UnitTestProduct"));
provider.setFeedbackServer(m_server.url());
provider.addDataSource(new ScreenInfoSource, Provider::AllStatistics);
provider.addDataSource(new PlatformInfoSource, Provider::AllStatistics);
provider.addDataSource(new ScreenInfoSource, Provider::DetailedUsageStatistics);
provider.addDataSource(new PlatformInfoSource, Provider::DetailedUsageStatistics);
provider.submit();
QTest::qWait(100); // HACK submit is async
......
......@@ -57,7 +57,7 @@ Provider::StatisticsCollectionMode AbstractDataSource::collectionMode() const
Q_ASSERT(d->mode != Provider::NoStatistics);
if (d->mode == Provider::NoStatistics)
return Provider::AllStatistics;
return Provider::DetailedUsageStatistics;
return d->mode;
}
......
......@@ -29,7 +29,7 @@ public:
virtual ~AbstractDataSourcePrivate();
QString name;
Provider::StatisticsCollectionMode mode = Provider::AllStatistics;
Provider::StatisticsCollectionMode mode = Provider::DetailedUsageStatistics;
};
}
......
......@@ -226,7 +226,7 @@ void ProviderPrivate::scheduleEncouragement()
if (encouragementStarts > startCount) // we need more starts
return;
if (statisticsMode == Provider::AllStatistics && surveyInterval == 0) // already everything enabled
if (statisticsMode == Provider::DetailedUsageStatistics && surveyInterval == 0) // already everything enabled
return;
Q_ASSERT(encouragementDelay >= 0);
......
......@@ -42,8 +42,7 @@ public:
BasicUsageStatistics,
DetailedSystemInformation,
DetailedUsageStatistics,
AllStatistics = DetailedUsageStatistics,
CollectionModeCount = AllStatistics
CollectionModeCount = DetailedUsageStatistics
};
Q_ENUMS(StatisticsCollectionMode)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment