Commit 9e510ed5 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Start to implement userfeedback support

parent e056fe7d
......@@ -59,9 +59,6 @@ find_package(KF5KCMUtils ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Crash ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5Libkleo ${LIBKLEO_LIB_VERSION} CONFIG REQUIRED)
option(DOMAIN_EXPERIMENTAL "Enable this feature if you want to build experimental domain library. Not Stable yet." FALSE)
# Find KdepimLibs Package
find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
......@@ -94,6 +91,14 @@ endif()
add_definitions(-DQT_NO_FOREACH)
find_package(KUserFeedback)
set_package_properties(KUserFeedback PROPERTIES DESCRIPTION "User Feedback lib" TYPE OPTIONAL PURPOSE "Allow to send Telemetry Information (optional). It can be disable in apps.")
if (TARGET KUserFeedbackWidgets)
add_definitions(-DWITH_KUSERFEEDBACK)
endif()
add_subdirectory(src)
add_subdirectory(kontactplugin)
......
configure_file(kaddressbook-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/kaddressbook-version.h @ONLY)
set(kaddressbook_userfeedback_LIB)
if (TARGET KUserFeedbackWidgets)
set(kaddressbook_userfeedback_LIB KUserFeedbackWidgets)
endif()
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/printing/
)
if (DOMAIN_EXPERIMENTAL)
add_subdirectory(domain)
add_subdirectory(akonadi)
endif()
add_subdirectory(icons)
add_subdirectory(printing)
add_subdirectory(kconf_update)
......@@ -46,6 +46,14 @@ set(kaddressbook_plugin_SRCS
plugininterface/kaddressbookplugininterface.cpp
)
set(kaddressbook_userfeedback_SRCS)
if (TARGET KUserFeedbackWidgets)
set(kaddressbook_userfeedback_SRCS ${kaddressbook_userfeedback_SRCS}
userfeedback/userfeedbackmanager.cpp
)
endif()
set(kaddressbook_LIB_SRCS
aboutdata.cpp
categoryfilterproxymodel.cpp
......@@ -60,6 +68,7 @@ set(kaddressbook_LIB_SRCS
kaddressbookmigrateapplication.cpp
${kaddressbook_printing_SRCS}
${kaddressbook_plugin_SRCS}
${kaddressbook_userfeedback_SRCS}
)
if (ECM_VERSION VERSION_LESS "5.68.0")
......@@ -99,6 +108,7 @@ target_link_libraries(kaddressbookprivate
KF5::I18n
KF5::KaddressbookImportExport
KF5::Prison
${kaddressbook_userfeedback_LIB}
)
if(QGpgme_FOUND)
......
/*
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 "userfeedbackmanager.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>
UserFeedBackManager::UserFeedBackManager(QObject *parent)
: QObject(parent)
{
mUserFeedbackProvider = new KUserFeedback::Provider(this);
mUserFeedbackProvider->setProductIdentifier(QStringLiteral("org.kde.kaddressbook"));
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);
}
UserFeedBackManager *UserFeedBackManager::self()
{
static UserFeedBackManager s_self;
return &s_self;
}
KUserFeedback::Provider *UserFeedBackManager::userFeedbackProvider() const
{
return mUserFeedbackProvider;
}
/*
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 USERFEEDBACKMANAGER_H
#define USERFEEDBACKMANAGER_H
#include <QObject>
namespace KUserFeedback {
class Provider;
}
class UserFeedBackManager : public QObject
{
Q_OBJECT
public:
explicit UserFeedBackManager(QObject *parent = nullptr);
static UserFeedBackManager *self();
KUserFeedback::Provider *userFeedbackProvider() const;
private:
KUserFeedback::Provider *mUserFeedbackProvider = nullptr;
};
#endif // USERFEEDBACKMANAGER_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