Effectsmodel: Load KCM by path instead of searching for plugin by id

This way we do not need to embed json metadata in the plugins
and can consequently drop the metadata files entirely.

The resulting metadata object might still be invalid, however KCoreAddons
can handle such cases. See https://phabricator.kde.org/T15094 regarding
create better KCoreAddons API for such cases.
master
Alexander Lohnau 3 years ago
parent c59c52cb0c
commit 728b449891

@ -623,12 +623,11 @@ QModelIndex EffectsModel::findByPluginId(const QString &pluginId) const
static KCModule *loadBinaryConfig(const QString &configModule, QObject *parent)
{
const KPluginMetaData metaData = KPluginMetaData::findPluginById(QStringLiteral("kwin/effects/configs/"), configModule);
if (!metaData.isValid()) {
if (configModule.isEmpty()) {
return nullptr;
}
const KPluginMetaData metaData(QStringLiteral("kwin/effects/configs/") + configModule);
return KPluginFactory::instantiatePlugin<KCModule>(metaData, parent).plugin;
}

Loading…
Cancel
Save