Commit 94346c23 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Start to implement userfeedback support

parent 22e00107
......@@ -49,6 +49,9 @@ set(LIBKLEO_LIB_VERSION_LIB "5.13.40")
set(MESSAGELIB_LIB_VERSION_LIB "5.13.55")
set(PIMCOMMON_LIB_VERSION_LIB "5.13.40")
option(KDEPIM_KUSERFEEDBACK "Enable user feedback support (experimental)" FALSE)
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test WebEngine WebEngineWidgets PrintSupport)
find_package(Grantlee5 "5.2" CONFIG REQUIRED)
......@@ -76,6 +79,12 @@ find_package(KF5WebEngineViewer ${MESSAGELIB_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5AkonadiMime ${AKONADI_MIMELIB_VERSION} CONFIG REQUIRED)
find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED)
if (KDEPIM_KUSERFEEDBACK)
#Optional
find_package(KUserFeedback)
endif()
include_directories(${akregator_SOURCE_DIR} ${akregator_BINARY_DIR})
add_definitions(-DTRANSLATION_DOMAIN=\"akregator\")
set(CMAKE_CXX_STANDARD 14)
......
......@@ -11,6 +11,9 @@ include_directories(
add_subdirectory(icons)
if (TARGET KUserFeedbackWidgets)
add_definitions(-DWITH_KUSERFEEDBACK)
endif()
########### next target ###############
......@@ -72,7 +75,17 @@ set(akregatorprivate_urlhandlerwebengine_SRCS
urlhandler/webengine/urlhandlerwebenginemanager.cpp
)
set(akregatorprivate_userfeedback_LIB_SRCS)
if (TARGET KUserFeedbackWidgets)
set(akregatorprivate_userfeedback_LIB_SRCS ${akregatorprivate_userfeedback_LIB_SRCS}
userfeedback/userfeedbackmanager.cpp
)
endif()
set(akregatorprivate_LIB_SRCS
${akregatorprivate_userfeedback_LIB_SRCS}
akregratormigrateapplication.cpp
${akregatorprivate_frame_SRCS}
${akregatorprivate_urlhandler_SRCS}
......@@ -109,6 +122,12 @@ qt5_add_resources(akregatorprivate_LIB_SRCS akregator.qrc)
add_library(akregatorprivate ${akregatorprivate_LIB_SRCS})
generate_export_header(akregatorprivate BASE_NAME akregator)
set(akregator_userfeedback_LIB)
if (TARGET KUserFeedbackWidgets)
set(akregator_userfeedback_LIB KUserFeedbackWidgets)
endif()
target_link_libraries(akregatorprivate
PRIVATE
KF5::Parts
......@@ -124,6 +143,7 @@ target_link_libraries(akregatorprivate
KF5::MessageViewer
Qt5::PrintSupport
KF5::WebEngineViewer
${akregator_userfeedback_LIB}
)
target_include_directories(akregatorprivate PUBLIC "$<BUILD_INTERFACE:${akregator_SOURCE_DIR}/src;${akregator_BINARY_DIR}/src>")
......
/*
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.korganizer"));
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