From a1639da6e5b3e4749a08481e16ee66c71e012060 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Tue, 21 Feb 2023 14:17:35 +0100 Subject: [PATCH] [kcm/common] Port EffectsModel away from KPluginMetaData::metaDataFileName It's gone in KF6 It's only used to obtain the install location of the package and resolve files relative to that Use QStandardPaths to locate those files directly --- src/kcms/common/effectsmodel.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/kcms/common/effectsmodel.cpp b/src/kcms/common/effectsmodel.cpp index 86e6064f57..382a125bcb 100644 --- a/src/kcms/common/effectsmodel.cpp +++ b/src/kcms/common/effectsmodel.cpp @@ -312,10 +312,8 @@ void EffectsModel::loadJavascriptEffects(const KConfigGroup &kwinConfig) const QString pluginKeyword = plugin.value(QStringLiteral("X-KDE-PluginKeyword")); if (!pluginKeyword.isEmpty()) { - QDir package(QFileInfo(plugin.metaDataFileName()).dir()); - package.cd(QStringLiteral("contents")); - const QString xmlFile = package.filePath(QStringLiteral("config/main.xml")); - const QString uiFile = package.filePath(QStringLiteral("ui/config.ui")); + const QString xmlFile = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("kwin/effects/") + plugin.pluginId() + QLatin1String("/contents/config/main.xml")); + const QString uiFile = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("kwin/effects/") + plugin.pluginId() + QLatin1String("/contents/ui/config.ui")); effect.configurable = QFileInfo::exists(xmlFile) && QFileInfo::exists(uiFile); } else { effect.configurable = false;