diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,6 +52,8 @@ QUIET ) +find_package(LibKWorkspace ${PROJECT_VERSION} REQUIRED) + # Disables automatic conversions from QString (or char *) to QUrl. add_definitions(-DQT_NO_URL_CAST_FROM_STRING) diff --git a/kcmshell/CMakeLists.txt b/kcmshell/CMakeLists.txt --- a/kcmshell/CMakeLists.txt +++ b/kcmshell/CMakeLists.txt @@ -11,6 +11,7 @@ KF5::I18n KF5::WindowSystem KF5::Activities + PW::KWorkspace ) install(TARGETS kdeinit_kcmshell5 ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/kcmshell/main.cpp b/kcmshell/main.cpp --- a/kcmshell/main.cpp +++ b/kcmshell/main.cpp @@ -40,6 +40,8 @@ #include #include +#include + #include #include #include @@ -174,7 +176,13 @@ extern "C" Q_DECL_EXPORT int kdemain(int _argc, char *_argv[]) { + const bool qpaVariable = qEnvironmentVariableIsSet("QT_QPA_PLATFORM"); + KWorkSpace::detectPlatform(argc, argv); KCMShell app(_argc, _argv); + if (!qpaVariable) { + // don't leak the env variable to processes we start + qunsetenv("QT_QPA_PLATFORM"); + } KLocalizedString::setApplicationDomain("kcmshell5"); app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);