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

Fix building without kuserfeedback

Unbreaks CI
parent f1f1597f
......@@ -6,7 +6,11 @@ endif()
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/..)
ecm_qt_declare_logging_category(plasma_discover_SRCS HEADER discover_debug.h IDENTIFIER DISCOVER_LOG CATEGORY_NAME org.kde.plasma.discover)
kconfig_add_kcfg_files(plasma_discover_SRCS discoversettings.kcfgc plasmauserfeedback.kcfgc GENERATE_MOC)
kconfig_add_kcfg_files(plasma_discover_SRCS discoversettings.kcfgc GENERATE_MOC)
if (TARGET KUserFeedbackCore)
kconfig_add_kcfg_files(plasma_discover_SRCS plasmauserfeedback.kcfgc GENERATE_MOC)
endif()
add_executable(plasma-discover ${plasma_discover_SRCS}
main.cpp
......@@ -34,9 +38,13 @@ target_link_libraries(plasma-discover PUBLIC
KF5::QuickAddons
Qt5::Quick
Discover::Common
KUserFeedbackCore
)
if (TARGET KUserFeedbackCore)
target_link_libraries(plasma-discover PRIVATE KUserFeedbackCore)
target_compile_definitions(plasma-discover PRIVATE WITH_FEEDBACK=1)
endif()
install(TARGETS plasma-discover ${INSTALL_TARGETS_DEFAULT_ARGS})
# if (BUILD_DummyBackend)
......
......@@ -72,7 +72,9 @@
#include <utils.h>
#include <QMimeDatabase>
#ifdef WITH_FEEDBACK
#include "plasmauserfeedback.h"
#endif
#include "discoversettings.h"
class CachedNetworkAccessManagerFactory : public QQmlNetworkAccessManagerFactory
......@@ -112,8 +114,9 @@ DiscoverObject::DiscoverObject(CompactMode mode)
qmlRegisterType<KConcatenateRowsProxyModel>("org.kde.discover.app", 1, 0, "KConcatenateRowsProxyModel");
qmlRegisterType<FeaturedModel>("org.kde.discover.app", 1, 0, "FeaturedModel");
qmlRegisterType<OurSortFilterProxyModel>("org.kde.discover.app", 1, 0, "QSortFilterProxyModel");
#ifdef WITH_FEEDBACK
qmlRegisterSingletonType<PlasmaUserFeedback>("org.kde.discover.app", 1, 0, "UserFeedbackSettings", [](QQmlEngine*, QJSEngine*) -> QObject* { return new PlasmaUserFeedback(KSharedConfig::openConfig(QStringLiteral("PlasmaUserFeedback"), KConfig::NoGlobals)); });
#endif
qmlRegisterSingletonType<DiscoverSettings>("org.kde.discover.app", 1, 0, "DiscoverSettings", [](QQmlEngine*, QJSEngine*) -> QObject* {
auto r = new DiscoverSettings;
connect(r, &DiscoverSettings::installedPageSortingChanged, r, &DiscoverSettings::save);
......
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