File indexing completed on 2024-12-15 04:55:36

0001 /*
0002    SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "userfeedbackmanager.h"
0008 #include <KUserFeedback/ApplicationVersionSource>
0009 #include <KUserFeedback/LocaleInfoSource>
0010 #include <KUserFeedback/PlatformInfoSource>
0011 #include <KUserFeedback/Provider>
0012 #include <KUserFeedback/QtVersionSource>
0013 #include <KUserFeedback/ScreenInfoSource>
0014 #include <KUserFeedback/StartCountSource>
0015 #include <KUserFeedback/UsageTimeSource>
0016 
0017 UserFeedBackManager::UserFeedBackManager(QObject *parent)
0018     : QObject(parent)
0019     , mUserFeedbackProvider(new KUserFeedback::Provider(this))
0020 {
0021     mUserFeedbackProvider->setProductIdentifier(QStringLiteral("org.kde.pim-sieve-editor"));
0022     mUserFeedbackProvider->setFeedbackServer(QUrl(QStringLiteral("https://telemetry.kde.org/")));
0023     mUserFeedbackProvider->setSubmissionInterval(7);
0024     mUserFeedbackProvider->setApplicationStartsUntilEncouragement(5);
0025     mUserFeedbackProvider->setEncouragementDelay(30);
0026 
0027     mUserFeedbackProvider->addDataSource(new KUserFeedback::ApplicationVersionSource);
0028     mUserFeedbackProvider->addDataSource(new KUserFeedback::PlatformInfoSource);
0029     mUserFeedbackProvider->addDataSource(new KUserFeedback::ScreenInfoSource);
0030     mUserFeedbackProvider->addDataSource(new KUserFeedback::QtVersionSource);
0031 
0032     mUserFeedbackProvider->addDataSource(new KUserFeedback::StartCountSource);
0033     mUserFeedbackProvider->addDataSource(new KUserFeedback::UsageTimeSource);
0034 
0035     mUserFeedbackProvider->addDataSource(new KUserFeedback::LocaleInfoSource);
0036 }
0037 
0038 UserFeedBackManager *UserFeedBackManager::self()
0039 {
0040     static UserFeedBackManager s_self;
0041     return &s_self;
0042 }
0043 
0044 KUserFeedback::Provider *UserFeedBackManager::userFeedbackProvider() const
0045 {
0046     return mUserFeedbackProvider;
0047 }
0048 
0049 #include "moc_userfeedbackmanager.cpp"