diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2022-04-01 17:08:54 +0200 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@qt.io> | 2023-05-25 13:50:40 +0000 |
commit | df020e63cf8f71856d0bc7e7fe873994f2e1c6ec (patch) | |
tree | 59e271954832ac2d227b3eff872167226f8c4446 | |
parent | e827bbd02582c08ef7d050fd50084b4a58e1171f (diff) |
On first start submit the data once after 10 minutes
This allows to collect the data for first time users that never come back.
Change-Id: I5c96660faecbd8b68e0923655483c870a2f408b5
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
-rw-r--r-- | src/usagestatisticplugin.cpp | 15 | ||||
-rw-r--r-- | src/usagestatisticplugin.h | 1 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/usagestatisticplugin.cpp b/src/usagestatisticplugin.cpp index 31c8423..6224111 100644 --- a/src/usagestatisticplugin.cpp +++ b/src/usagestatisticplugin.cpp @@ -49,7 +49,7 @@ #include <KUserFeedback/UsageTimeSource> #include <KUserFeedback/StyleInfoSource> -#include "datasources/applicationsource.h".h " +#include "datasources/applicationsource.h" #include "datasources/buildcountsource.h" #include "datasources/buildsystemsource.h" #include "datasources/examplesdatasource.h" @@ -66,6 +66,8 @@ #include "common/utils.h" +#include <QTimer> + namespace UsageStatistic { namespace Internal { @@ -141,6 +143,7 @@ bool UsageStatisticPlugin::delayedInitialize() restoreSettings(); showFirstTimeMessage(); + submitDataOnFirstStart(); return true; } @@ -216,6 +219,16 @@ void UsageStatisticPlugin::showFirstTimeMessage() } } +void UsageStatisticPlugin::submitDataOnFirstStart() +{ + /* + * On first start submit data after 10 minutes. + */ + + if (m_provider && runFirstTime(*m_provider) && !telemetryLevelNotSet(*m_provider)) + QTimer::singleShot(1000 * 60 * 10, this, [this]() { m_provider->submit(); }); +} + static ::Utils::InfoBarEntry makeInfoBarEntry() { static auto infoText = UsageStatisticPlugin::tr( diff --git a/src/usagestatisticplugin.h b/src/usagestatisticplugin.h index 0fb6278..a74624e 100644 --- a/src/usagestatisticplugin.h +++ b/src/usagestatisticplugin.h @@ -59,6 +59,7 @@ private: void createProvider(); void showEncouragementMessage(); void showFirstTimeMessage(); + void submitDataOnFirstStart(); private: std::shared_ptr<KUserFeedback::Provider> m_provider; |