From 54602237fd018a7212cadea5210a1908584ee110 Mon Sep 17 00:00:00 2001 From: Martin Klapetek Date: Mon, 14 Dec 2015 09:04:06 -0500 Subject: [PATCH] Read KPluginMetada's property X-Plasma-ComponentTypes as a stringlist plasma-scriptengine.desktop defines the property "X-Plasma- ComponentTypes" as Type=QStringList. When reading it using KPluginMetaData::value(..) it expects a QString back. This used to work but regressed in kcoreaddons in commit cfd18cf09b559a050fd6a2680ad4e71eeb950383.Making it read the property as a stringlist works and is correct and also fixes Plasma startup. REVIEW: 126320 --- src/plasma/scripting/scriptengine.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plasma/scripting/scriptengine.cpp b/src/plasma/scripting/scriptengine.cpp index 1b132de99..a66bcf0db 100644 --- a/src/plasma/scripting/scriptengine.cpp +++ b/src/plasma/scripting/scriptengine.cpp @@ -64,9 +64,9 @@ QStringList knownLanguages(Types::ComponentTypes types) const QVector plugins = KPluginLoader::findPlugins(QStringLiteral("plasma/scriptengines")); for (auto plugin : plugins) { - const QString componentTypes = plugin.value(QStringLiteral("X-Plasma-ComponentTypes")); - if (((types & Types::AppletComponent) && componentTypes == QLatin1String("Applet")) - ||((types & Types::DataEngineComponent) && componentTypes == QLatin1String("DataEngine"))) { + const QStringList componentTypes = KPluginMetaData::readStringList(plugins.first().rawData(), QStringLiteral("X-Plasma-ComponentTypes")); + if (((types & Types::AppletComponent) && !componentTypes.contains(QLatin1String("Applet"))) + ||((types & Types::DataEngineComponent) && !componentTypes.contains(QLatin1String("DataEngine")))) { languages << plugin.value(QStringLiteral("X-Plasma-API")); } } @@ -86,9 +86,9 @@ ScriptEngine *loadEngine(const QString &language, Types::ComponentType type, QOb QVector plugins = KPluginLoader::findPlugins(QStringLiteral("plasma/scriptengines"), filter); if (plugins.count()) { - const QString componentTypes = plugins.first().value(QStringLiteral("X-Plasma-ComponentTypes")); - if (((type & Types::AppletComponent) && componentTypes != QLatin1String("Applet")) - || ((type & Types::DataEngineComponent) && componentTypes != QLatin1String("DataEngine"))) { + const QStringList componentTypes = KPluginMetaData::readStringList(plugins.first().rawData(), QStringLiteral("X-Plasma-ComponentTypes")); + if (((type & Types::AppletComponent) && !componentTypes.contains(QLatin1String("Applet"))) + || ((type & Types::DataEngineComponent) && !componentTypes.contains(QLatin1String("DataEngine")))) { return 0; } KPluginInfo::List lst = KPluginInfo::fromMetaData(plugins);