[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
remotes/origin/work/zzag/track-stack-order
Nicolas Fella 3 years ago committed by Vlad Zahorodnii
parent 2de5236e3f
commit a1639da6e5
  1. 6
      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;

Loading…
Cancel
Save