Commit 3e7ac98f authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Default to qqc2-desktop-style and add it as runtime dependency

On Plasma qqc2-desktop-style is used automatically, but not on other
DEs. Set it as a default and allow overriding it via environment
variables.

Also add it as a runtime dep so distros actually ship it.
parent 5d037396
Pipeline #54828 passed with stage
in 5 minutes and 58 seconds
......@@ -87,7 +87,7 @@ endif()
add_definitions(-DQT_NO_URL_CAST_FROM_STRING -DQT_NO_KEYWORDS -DQT_NO_CAST_FROM_ASCII)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS DBus Quick Network Multimedia)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS DBus Quick QuickControls2 Network Multimedia)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS ${KF5_REQUIRED_COMPONENTS})
if (KF5_OPTIONAL_COMPONENTS)
find_package(KF5 ${KF5_MIN_VERSION} COMPONENTS ${KF5_OPTIONAL_COMPONENTS})
......@@ -107,6 +107,10 @@ add_subdirectory(plugins)
add_subdirectory(interfaces)
if (NOT SAILFISHOS)
find_package(KF5QQC2DesktopStyle ${KF5_MIN_VERSION} REQUIRED)
set_package_properties(KF5QQC2DesktopStyle PROPERTIES TYPE RUNTIME)
add_subdirectory(icons)
add_subdirectory(data)
add_subdirectory(cli)
......
qt5_add_resources(kdeconnect_SRCS resources.qrc)
add_executable(kdeconnect-app main.cpp ${kdeconnect_SRCS})
target_link_libraries(kdeconnect-app Qt5::Quick Qt5::Widgets KF5::CoreAddons KF5::I18n)
target_link_libraries(kdeconnect-app Qt5::Quick Qt5::QuickControls2 Qt5::Widgets KF5::CoreAddons KF5::I18n)
install(TARGETS kdeconnect-app ${INSTALL_TARGETS_DEFAULT_ARGS})
install(PROGRAMS org.kde.kdeconnect.app.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
......@@ -9,6 +9,7 @@
#include <QQmlApplicationEngine>
#include <QCommandLineParser>
#include <QQmlContext>
#include <QQuickStyle>
#include <QStandardPaths>
#include <KAboutData>
......@@ -24,6 +25,11 @@ int main(int argc, char* argv[])
aboutData.addAuthor(i18n("Aleix Pol Gonzalez"), i18n("Maintainer"), QStringLiteral("aleixpol@kde.org"));
KAboutData::setApplicationData(aboutData);
// Default to org.kde.desktop style unless the user forces another style
if (qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE")) {
QQuickStyle::setStyle(QStringLiteral("org.kde.desktop"));
}
{
QCommandLineParser parser;
aboutData.setupCommandLine(&parser);
......
......@@ -50,6 +50,7 @@ target_link_libraries(kdeconnect-sms
kdeconnectinterfaces
kdeconnectversion
Qt5::Quick
Qt5::QuickControls2
Qt5::Widgets
KF5::CoreAddons
KF5::DBusAddons
......
......@@ -15,6 +15,7 @@
#include <QQmlApplicationEngine>
#include <QCommandLineParser>
#include <QQmlContext>
#include <QQuickStyle>
#include <KAboutData>
#include <KLocalizedString>
#include <KLocalizedContext>
......@@ -39,6 +40,11 @@ int main(int argc, char *argv[])
aboutData.addAuthor(i18n("Nicolas Fella"), {}, QStringLiteral("nicolas.fella@gmx.de"));
KAboutData::setApplicationData(aboutData);
// Default to org.kde.desktop style unless the user forces another style
if (qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE")) {
QQuickStyle::setStyle(QStringLiteral("org.kde.desktop"));
}
QString initialMessage, deviceid;
{
......
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