From f2dd50e1f9c6d617b78805b167b55b7f00953472 Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Sat, 25 Dec 2021 11:25:30 +0100 Subject: [PATCH] Clean up legacy configmodule querying In KWin we are allowed to break compat and here all first party consumers have already been ported for quite a while. Also the querying is very inefficient, because for every plugin where the X-KDE-ConfigModule property is not defined all available KCMs have to be opened and their metadata parsed. This way we also get rid of the deprecation warning for KPluginMetaData::readStringList. --- src/kcmkwin/common/effectsmodel.cpp | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/kcmkwin/common/effectsmodel.cpp b/src/kcmkwin/common/effectsmodel.cpp index b846b27583..4cf88cb4c3 100644 --- a/src/kcmkwin/common/effectsmodel.cpp +++ b/src/kcmkwin/common/effectsmodel.cpp @@ -357,23 +357,6 @@ void EffectsModel::loadPluginEffects(const KConfigGroup &kwinConfig) effect.kind = Kind::Binary; effect.configModule = pluginEffect.value(QStringLiteral("X-KDE-ConfigModule")); - // Compatibility with plugins that don't have ConfigModule in their metadata - // TODO KF6 remove - if (effect.configModule.isEmpty()) { - - auto filter = [pluginEffect](const KPluginMetaData &md) -> bool - { - const QStringList parentComponents = KPluginMetaData::readStringList(md.rawData(), QStringLiteral("X-KDE-ParentComponents")); - return parentComponents.contains(pluginEffect.pluginId()); - }; - - const QVector plugins = KPluginMetaData::findPlugins(QStringLiteral("kwin/effects/configs/"), filter); - - if (!plugins.isEmpty()) { - effect.configModule = plugins.first().pluginId(); - } - } - for (int i = 0; i < pluginEffect.authors().count(); ++i) { effect.authorName.append(pluginEffect.authors().at(i).name()); effect.authorEmail.append(pluginEffect.authors().at(i).emailAddress());