Commit 896dd551 authored by Fabian Vogt's avatar Fabian Vogt
Browse files

Use platform detection from KWorkSpace in KCMShell

Summary: In a Wayland session, KCMs need to use the wayland platform plugin.

Test Plan: kcmshell5 kscreen now works properly.

Reviewers: #plasma, romangg

Reviewed By: #plasma, romangg

Subscribers: romangg, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D11739
parent b42b3f26
......@@ -52,6 +52,8 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
QUIET
)
find_package(LibKWorkspace ${PROJECT_VERSION} REQUIRED)
# Disables automatic conversions from QString (or char *) to QUrl.
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
......
......@@ -11,6 +11,7 @@ target_link_libraries(kdeinit_kcmshell5
KF5::I18n
KF5::WindowSystem
KF5::Activities
PW::KWorkspace
)
install(TARGETS kdeinit_kcmshell5 ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......
......@@ -40,6 +40,8 @@
#include <KStartupInfo>
#include <KActivities/ResourceInstance>
#include <kworkspace.h>
#include <QIcon>
#include <QCommandLineParser>
#include <QCommandLineOption>
......@@ -174,7 +176,13 @@ void KCMShell::appExit(const QString &appId, const QString &oldName, const QStri
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);
......
Supports Markdown
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