Commit 71c4feb8 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to show feeback type

parent e6bf2d51
......@@ -190,6 +190,7 @@ if (TARGET KUserFeedbackWidgets)
set(kmailprivate_userfeedback_LIB_SRCS ${kmailprivate_userfeedback_LIB_SRCS}
userfeedback/accountinfosource.cpp
userfeedback/plugininfosource.cpp
userfeedback/kmailuserfeedbackprovider.cpp
)
endif()
......@@ -405,6 +406,7 @@ target_link_libraries(kmail
KF5::TemplateParser
KF5::Libkdepim
KF5::Crash
${kmail_userfeedback_LIB}
)
if(BUILD_TESTING)
......
......@@ -113,18 +113,9 @@ 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>
#include <KUserFeedback/StartCountSource>
#include <KUserFeedback/UsageTimeSource>
#include <KUserFeedback/LocaleInfoSource>
#include "userfeedback/accountinfosource.h"
#include "userfeedback/plugininfosource.h"
#include "userfeedback/kmailuserfeedbackprovider.h"
#endif
......@@ -144,27 +135,8 @@ KMKernel::KMKernel(QObject *parent)
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->addDataSource(new KUserFeedback::StartCountSource);
mUserFeedbackProvider->addDataSource(new KUserFeedback::UsageTimeSource);
mUserFeedbackProvider->addDataSource(new KUserFeedback::LocaleInfoSource);
mUserFeedbackProvider->addDataSource(new AccountInfoSource);
mUserFeedbackProvider->addDataSource(new PluginInfoSource);
mUserFeedbackProvider = new KMailUserFeedbackProvider(this);
#endif
mSystemNetworkStatus = PimCommon::NetworkManager::self()->networkConfigureManager()->isOnline();
Akonadi::AttributeFactory::registerAttribute<Akonadi::SearchDescriptionAttribute>();
......
......@@ -76,6 +76,7 @@ class MailCommonSettings;
}
#ifdef WITH_KUSERFEEDBACK
class KMailUserFeedbackProvider;
namespace KUserFeedback {
class Provider;
}
......@@ -531,7 +532,7 @@ private:
Akonadi::Search::PIM::IndexedItems *mIndexedItems = nullptr;
MailCommon::MailCommonSettings *mMailCommonSettings = nullptr;
#ifdef WITH_KUSERFEEDBACK
KUserFeedback::Provider *mUserFeedbackProvider = nullptr;
KMailUserFeedbackProvider *mUserFeedbackProvider = nullptr;
#endif
bool mDebug = false;
......
......@@ -35,6 +35,11 @@
#include <QSessionManager>
#include <KCrash>
#ifdef WITH_KUSERFEEDBACK
#include <KUserFeedback/Provider>
#include "userfeedback/kmailuserfeedbackprovider.h"
#endif
//-----------------------------------------------------------------------------
class KMailApplication : public KontactInterface::PimUniqueApplication
......@@ -137,7 +142,9 @@ int main(int argc, char *argv[])
#ifdef WITH_KUSERFEEDBACK
if(cmdArgs->isSet(QStringLiteral("feedback"))) {
//QTextStream(stdout) << UserFeedBackManager::self()->userFeedbackProvider()->describeDataSources() << '\n';
KMailUserFeedbackProvider *userFeedback = new KMailUserFeedbackProvider(nullptr);
QTextStream(stdout) << userFeedback->describeDataSources() << '\n';
delete userFeedback;
return 0;
}
#endif
......
/*
Copyright (C) 2020 Laurent Montel <montel@kde.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "kmailuserfeedbackprovider.h"
#include <KUserFeedback/ApplicationVersionSource>
#include <KUserFeedback/PlatformInfoSource>
#include <KUserFeedback/ScreenInfoSource>
#include <KUserFeedback/QtVersionSource>
#include <KUserFeedback/Provider>
#include <KUserFeedback/StartCountSource>
#include <KUserFeedback/UsageTimeSource>
#include <KUserFeedback/LocaleInfoSource>
#include "userfeedback/accountinfosource.h"
#include "userfeedback/plugininfosource.h"
KMailUserFeedbackProvider::KMailUserFeedbackProvider(QObject *parent)
: KUserFeedback::Provider(parent)
{
setProductIdentifier(QStringLiteral("org.kde.kmail"));
setFeedbackServer(QUrl(QStringLiteral("https://telemetry.kde.org/")));
setSubmissionInterval(7);
setApplicationStartsUntilEncouragement(5);
setEncouragementDelay(30);
addDataSource(new KUserFeedback::ApplicationVersionSource);
addDataSource(new KUserFeedback::PlatformInfoSource);
addDataSource(new KUserFeedback::ScreenInfoSource);
addDataSource(new KUserFeedback::QtVersionSource);
addDataSource(new KUserFeedback::StartCountSource);
addDataSource(new KUserFeedback::UsageTimeSource);
addDataSource(new KUserFeedback::LocaleInfoSource);
addDataSource(new AccountInfoSource);
addDataSource(new PluginInfoSource);
}
KMailUserFeedbackProvider::~KMailUserFeedbackProvider()
{
}
/*
Copyright (C) 2020 Laurent Montel <montel@kde.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KMAILUSERFEEDBACKPROVIDER_H
#define KMAILUSERFEEDBACKPROVIDER_H
#include <KUserFeedback/Provider>
#include "kmail_export.h"
class KMAIL_EXPORT KMailUserFeedbackProvider : public KUserFeedback::Provider
{
Q_OBJECT
public:
explicit KMailUserFeedbackProvider(QObject *parent = nullptr);
~KMailUserFeedbackProvider();
};
#endif // KMAILUSERFEEDBACKPROVIDER_H
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