Commit 48e50768 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

implement provider

parent 98318550
......@@ -19,7 +19,7 @@
#include "PimCommon/ConfigureImmutableWidgetUtils"
using namespace PimCommon::ConfigureImmutableWidgetUtils;
#include "settings/kmailsettings.h"
#include "kmkernel.h"
#include <MailCommon/FolderRequester>
#include "MessageViewer/InvitationSettings"
#include "MessageViewer/PrintingSettings"
......@@ -189,6 +189,11 @@ KuserFeedBackPagePrintingTab::KuserFeedBackPagePrintingTab(QWidget *parent)
QHBoxLayout *l = new QHBoxLayout(this);
l->setContentsMargins(0, 0, 0, 0);
l->addWidget(mUserFeedbackWidget);
connect(mUserFeedbackWidget, &KUserFeedback::FeedbackConfigWidget::configurationChanged, this, &KuserFeedBackPagePrintingTab::slotEmitChanged);
if (KMKernel::self()) {
mUserFeedbackWidget->setFeedbackProvider(KMKernel::self()->userFeedbackProvider());
}
}
void KuserFeedBackPagePrintingTab::save()
......
......@@ -113,6 +113,16 @@ using KMail::MailServiceImpl;
#include "searchdialog/searchdescriptionattribute.h"
#include "kmail_options.h"
#ifdef WITH_KUSERFEEDBACK
#include <KUserFeedback/ApplicationVersionSource>
#include <KUserFeedback/PlatformInfoSource>
#include <KUserFeedback/ScreenInfoSource>
#include <KUserFeedback/QtVersionSource>
#include <KUserFeedback/Provider>
#endif
//#define DEBUG_SCHEDULER 1
using namespace MailCommon;
......@@ -128,6 +138,23 @@ KMKernel::KMKernel(QObject *parent)
KSieveUi::SieveImapInstanceInterfaceManager::self()->setSieveImapInstanceInterface(new KMailSieveImapInstanceInterface);
mDebug = !qEnvironmentVariableIsEmpty("KDEPIM_DEBUGGING");
#ifdef WITH_KUSERFEEDBACK
mUserFeedbackProvider = new KUserFeedback::Provider(this);
mUserFeedbackProvider->setProductIdentifier(QStringLiteral("org.kde.kmail"));
mUserFeedbackProvider->setFeedbackServer(QUrl(QStringLiteral("https://telemetry.kde.org/")));
mUserFeedbackProvider->setSubmissionInterval(7);
mUserFeedbackProvider->setApplicationStartsUntilEncouragement(5);
mUserFeedbackProvider->setEncouragementDelay(30);
mUserFeedbackProvider->addDataSource(new KUserFeedback::ApplicationVersionSource);
mUserFeedbackProvider->addDataSource(new KUserFeedback::PlatformInfoSource);
mUserFeedbackProvider->addDataSource(new KUserFeedback::ScreenInfoSource);
mUserFeedbackProvider->addDataSource(new KUserFeedback::QtVersionSource);
mUserFeedbackProvider->setTelemetryMode(KUserFeedback::Provider::TelemetryMode(KSharedConfig::openConfig()->group("General").readEntry("TelemetryMode", int(KUserFeedback::Provider::NoTelemetry))));
#endif
mSystemNetworkStatus = PimCommon::NetworkManager::self()->networkConfigureManager()->isOnline();
Akonadi::AttributeFactory::registerAttribute<Akonadi::SearchDescriptionAttribute>();
......@@ -1950,3 +1977,10 @@ void KMKernel::expunge(Akonadi::Collection::Id col, bool sync)
Q_UNUSED(col);
Q_UNUSED(sync);
}
#ifdef WITH_KUSERFEEDBACK
KUserFeedback::Provider *KMKernel::userFeedbackProvider() const
{
return mUserFeedbackProvider;
}
#endif
......@@ -75,6 +75,12 @@ class KMFilterDialog;
class MailCommonSettings;
}
#ifdef WITH_KUSERFEEDBACK
namespace KUserFeedback {
class Provider;
}
#endif
class QTimer;
class KMainWindow;
class KMMainWidget;
......@@ -410,7 +416,9 @@ public:
void cleanupTemporaryFiles();
MailCommon::MailCommonSettings *mailCommonSettings() const;
#ifdef WITH_KUSERFEEDBACK
KUserFeedback::Provider *userFeedbackProvider() const;
#endif
protected:
void agentInstanceBroken(const Akonadi::AgentInstance &instance);
......@@ -522,6 +530,10 @@ private:
CheckIndexingManager *mCheckIndexingManager = nullptr;
Akonadi::Search::PIM::IndexedItems *mIndexedItems = nullptr;
MailCommon::MailCommonSettings *mMailCommonSettings = nullptr;
#ifdef WITH_KUSERFEEDBACK
KUserFeedback::Provider *mUserFeedbackProvider = nullptr;
#endif
bool mDebug = false;
};
......
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