diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,7 +6,6 @@ ecm_mark_nongui_executable(kded5) target_link_libraries(kdeinit_kded5 - Qt5::Widgets # QApplication KF5::Service # Needed for ksycoca.h KF5::CoreAddons # Needed for KDirWatch KF5::DBusAddons # Needed for kdedmodule.h diff --git a/src/kded.cpp b/src/kded.cpp --- a/src/kded.cpp +++ b/src/kded.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include @@ -317,8 +317,12 @@ bool Kded::platformSupportsModule(const KPluginMetaData &module) const { const QStringList supportedPlatforms = KPluginMetaData::readStringList(module.rawData(), QStringLiteral("X-KDE-OnlyShowOnQtPlatforms")); - - return supportedPlatforms.isEmpty() || supportedPlatforms.contains(qApp->platformName()); + if (!supportedPlatforms.isEmpty()) + { + const QByteArray platformName = qgetenv("QT_QPA_PLATFORM"); + return supportedPlatforms.contains(QString::fromLocal8Bit(platformName)); + } + return true; } bool Kded::isModuleLoadedOnDemand(const QString &obj) const @@ -678,10 +682,9 @@ QStandardPaths::setTestModeEnabled(true); } -static void setupAppInfo(QApplication *app) +static void setupAppInfo(QCoreApplication *app) { app->setApplicationName(QStringLiteral("kded5")); - app->setApplicationDisplayName(QStringLiteral("KDE Daemon")); app->setOrganizationDomain(QStringLiteral("kde.org")); app->setApplicationVersion(QStringLiteral(KDED_VERSION_STRING)); } @@ -740,12 +743,11 @@ // testing for --check, in which case, only a QCoreApplication was created. // Since that option is no longer used at startup, we removed that speed // optimization for code clarity and easier support of standard parameters. - QApplication app(argc, argv); + QCoreApplication app(argc, argv); if (unsetQpa) { qunsetenv("QT_QPA_PLATFORM"); } setupAppInfo(&app); - app.setQuitOnLastWindowClosed(false); QCommandLineParser parser; parser.addHelpOption();