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
This commit is contained in:
parent
9b48e3d010
commit
54602237fd
|
@ -64,9 +64,9 @@ QStringList knownLanguages(Types::ComponentTypes types)
|
||||||
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("plasma/scriptengines"));
|
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("plasma/scriptengines"));
|
||||||
|
|
||||||
for (auto plugin : plugins) {
|
for (auto plugin : plugins) {
|
||||||
const QString componentTypes = plugin.value(QStringLiteral("X-Plasma-ComponentTypes"));
|
const QStringList componentTypes = KPluginMetaData::readStringList(plugins.first().rawData(), QStringLiteral("X-Plasma-ComponentTypes"));
|
||||||
if (((types & Types::AppletComponent) && componentTypes == QLatin1String("Applet"))
|
if (((types & Types::AppletComponent) && !componentTypes.contains(QLatin1String("Applet")))
|
||||||
||((types & Types::DataEngineComponent) && componentTypes == QLatin1String("DataEngine"))) {
|
||((types & Types::DataEngineComponent) && !componentTypes.contains(QLatin1String("DataEngine")))) {
|
||||||
languages << plugin.value(QStringLiteral("X-Plasma-API"));
|
languages << plugin.value(QStringLiteral("X-Plasma-API"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,9 +86,9 @@ ScriptEngine *loadEngine(const QString &language, Types::ComponentType type, QOb
|
||||||
QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("plasma/scriptengines"), filter);
|
QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("plasma/scriptengines"), filter);
|
||||||
|
|
||||||
if (plugins.count()) {
|
if (plugins.count()) {
|
||||||
const QString componentTypes = plugins.first().value(QStringLiteral("X-Plasma-ComponentTypes"));
|
const QStringList componentTypes = KPluginMetaData::readStringList(plugins.first().rawData(), QStringLiteral("X-Plasma-ComponentTypes"));
|
||||||
if (((type & Types::AppletComponent) && componentTypes != QLatin1String("Applet"))
|
if (((type & Types::AppletComponent) && !componentTypes.contains(QLatin1String("Applet")))
|
||||||
|| ((type & Types::DataEngineComponent) && componentTypes != QLatin1String("DataEngine"))) {
|
|| ((type & Types::DataEngineComponent) && !componentTypes.contains(QLatin1String("DataEngine")))) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
KPluginInfo::List lst = KPluginInfo::fromMetaData(plugins);
|
KPluginInfo::List lst = KPluginInfo::fromMetaData(plugins);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user