kcms: Fix plugin id loading in desktop effects kcm

kwin installs metadata files for builtin effects so the kcm can find
them. With the recent KPluginMetaData changes, the Id field has been
removed, so the kcm will use "metadata" (the basename of metadata.json)
as the plugin id.

In order to fix plugin id resolution, let's install metadata with the
file name same as the plugin id.
master
Vlad Zahorodnii 2 years ago
parent 5dd247d179
commit 5b6b2a2219

@ -34,7 +34,7 @@ macro(KWIN4_ADD_EFFECT_MODULE name)
kcoreaddons_add_plugin(${name} STATIC SOURCES ${ARGN} INSTALL_NAMESPACE "kwin/effects/plugins")
set_property(TARGET ${name} PROPERTY POSITION_INDEPENDENT_CODE ON)
kwin_strip_builtin_effect_metadata(${name} metadata.json)
install(FILES metadata.json DESTINATION ${KDE_INSTALL_DATADIR}/kwin/builtin-effects/${name}/)
install(FILES metadata.json DESTINATION ${KDE_INSTALL_DATADIR}/kwin/builtin-effects/ RENAME ${name}.json)
endmacro()
# Install the KWin/Effect service type

@ -225,8 +225,8 @@ void EffectsModel::loadBuiltInEffects(const KConfigGroup &kwinConfig)
QStringLiteral("kwin/builtin-effects"),
QStandardPaths::LocateDirectory);
const QStringList nameFilters{QStringLiteral("metadata.json")};
QDirIterator it(rootDirectory, nameFilters, QDir::Files, QDirIterator::Subdirectories);
const QStringList nameFilters{QStringLiteral("*.json")};
QDirIterator it(rootDirectory, nameFilters, QDir::Files);
while (it.hasNext()) {
it.next();

Loading…
Cancel
Save