Commit e5f77a10 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Fix build without KUserFeedback

parent 6257b863
...@@ -71,8 +71,12 @@ target_link_libraries(plasmashell ...@@ -71,8 +71,12 @@ target_link_libraries(plasmashell
KF5::WaylandClient KF5::WaylandClient
KF5::Notifications KF5::Notifications
PW::KWorkspace PW::KWorkspace
KUserFeedbackCore
) )
if (TARGET KUserFeedbackCore)
target_link_libraries(plasmashell KUserFeedbackCore)
target_compile_definitions(plasmashell PRIVATE -DWITH_KUSERFEEDBACKCORE)
endif()
target_include_directories(plasmashell PRIVATE "${CMAKE_BINARY_DIR}") target_include_directories(plasmashell PRIVATE "${CMAKE_BINARY_DIR}")
target_compile_definitions(plasmashell PRIVATE -DPROJECT_VERSION="${PROJECT_VERSION}") target_compile_definitions(plasmashell PRIVATE -DPROJECT_VERSION="${PROJECT_VERSION}")
......
...@@ -51,6 +51,8 @@ ...@@ -51,6 +51,8 @@
#include <kdeclarative/qmlobjectsharedengine.h> #include <kdeclarative/qmlobjectsharedengine.h>
#include <KMessageBox> #include <KMessageBox>
#include <kdirwatch.h> #include <kdirwatch.h>
#ifdef WITH_KUSERFEEDBACKCORE
#include <KUserFeedback/Provider> #include <KUserFeedback/Provider>
#include <KUserFeedback/ApplicationVersionSource> #include <KUserFeedback/ApplicationVersionSource>
#include <KUserFeedback/CompilerInfoSource> #include <KUserFeedback/CompilerInfoSource>
...@@ -60,6 +62,9 @@ ...@@ -60,6 +62,9 @@
#include <KUserFeedback/OpenGLInfoSource> #include <KUserFeedback/OpenGLInfoSource>
#include <KUserFeedback/ScreenInfoSource> #include <KUserFeedback/ScreenInfoSource>
#include "panelcountsource.h"
#endif
#include <KPackage/PackageLoader> #include <KPackage/PackageLoader>
#include <KWayland/Client/connection_thread.h> #include <KWayland/Client/connection_thread.h>
...@@ -78,7 +83,6 @@ ...@@ -78,7 +83,6 @@
#include "plasmashelladaptor.h" #include "plasmashelladaptor.h"
#include "debug.h" #include "debug.h"
#include "futureutil.h" #include "futureutil.h"
#include "panelcountsource.h"
#ifndef NDEBUG #ifndef NDEBUG
#define CHECK_SCREEN_INVARIANTS screenInvariants(); #define CHECK_SCREEN_INVARIANTS screenInvariants();
...@@ -281,25 +285,27 @@ void ShellCorona::setShell(const QString &shell) ...@@ -281,25 +285,27 @@ void ShellCorona::setShell(const QString &shell)
t->setThemeName(themeName); t->setThemeName(themeName);
} }
auto m_feedbackProvider = new KUserFeedback::Provider(this); #ifdef WITH_KUSERFEEDBACKCORE
m_feedbackProvider->setProductIdentifier(QStringLiteral("org.kde.plasmashell")); auto feedbackProvider = new KUserFeedback::Provider(this);
m_feedbackProvider->setFeedbackServer(QUrl(QStringLiteral("https://telemetry.kde.org/"))); feedbackProvider->setProductIdentifier(QStringLiteral("org.kde.plasmashell"));
m_feedbackProvider->setSubmissionInterval(7); feedbackProvider->setFeedbackServer(QUrl(QStringLiteral("https://telemetry.kde.org/")));
m_feedbackProvider->setApplicationStartsUntilEncouragement(5); feedbackProvider->setSubmissionInterval(7);
m_feedbackProvider->setEncouragementDelay(30); feedbackProvider->setApplicationStartsUntilEncouragement(5);
m_feedbackProvider->addDataSource(new KUserFeedback::ApplicationVersionSource); feedbackProvider->setEncouragementDelay(30);
m_feedbackProvider->addDataSource(new KUserFeedback::CompilerInfoSource); feedbackProvider->addDataSource(new KUserFeedback::ApplicationVersionSource);
m_feedbackProvider->addDataSource(new KUserFeedback::PlatformInfoSource); feedbackProvider->addDataSource(new KUserFeedback::CompilerInfoSource);
m_feedbackProvider->addDataSource(new KUserFeedback::QtVersionSource); feedbackProvider->addDataSource(new KUserFeedback::PlatformInfoSource);
m_feedbackProvider->addDataSource(new KUserFeedback::UsageTimeSource); feedbackProvider->addDataSource(new KUserFeedback::QtVersionSource);
m_feedbackProvider->addDataSource(new KUserFeedback::OpenGLInfoSource); feedbackProvider->addDataSource(new KUserFeedback::UsageTimeSource);
m_feedbackProvider->addDataSource(new KUserFeedback::ScreenInfoSource); feedbackProvider->addDataSource(new KUserFeedback::OpenGLInfoSource);
m_feedbackProvider->addDataSource(new PanelCountSource(this)); feedbackProvider->addDataSource(new KUserFeedback::ScreenInfoSource);
feedbackProvider->addDataSource(new PanelCountSource(this));
{ {
auto plasmaConfig = KSharedConfig::openConfig(QStringLiteral("PlasmaUserFeedback")); auto plasmaConfig = KSharedConfig::openConfig(QStringLiteral("PlasmaUserFeedback"));
m_feedbackProvider->setTelemetryMode(KUserFeedback::Provider::TelemetryMode(plasmaConfig->group("Global").readEntry("FeedbackLevel", int(KUserFeedback::Provider::BasicUsageStatistics)))); feedbackProvider->setTelemetryMode(KUserFeedback::Provider::TelemetryMode(plasmaConfig->group("Global").readEntry("FeedbackLevel", int(KUserFeedback::Provider::BasicUsageStatistics))));
} }
#endif
//FIXME: this would change the runtime platform to a fixed one if available //FIXME: this would change the runtime platform to a fixed one if available
// but a different way to load platform specific components is needed beforehand // but a different way to load platform specific components is needed beforehand
......
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