diff --git a/src/kded.h b/src/kded.h --- a/src/kded.h +++ b/src/kded.h @@ -83,6 +83,13 @@ bool isModuleAutoloaded(const QString &module) const; //@} + //@{ + /** + * Check if a module is supported on the current QPA + */ + bool platformSupportsModule(const KPluginMetaData &module) const; + //@} + //@{ /** * Check if a module should be loaded on demand diff --git a/src/kded.cpp b/src/kded.cpp --- a/src/kded.cpp +++ b/src/kded.cpp @@ -231,6 +231,9 @@ foreach (const KPluginMetaData &module, kdedModules) { // Should the service load on startup? const bool autoload = isModuleAutoloaded(module); + if (!platformSupportsModule(module)) { + continue; + } // see ksmserver's README for description of the phases bool prevent_autoload = false; @@ -320,6 +323,13 @@ return autoload; } +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()); +} + bool Kded::isModuleLoadedOnDemand(const QString &obj) const { return isModuleLoadedOnDemand(findModule(obj));