diff --git a/scripting/scripting.cpp b/scripting/scripting.cpp index 9df75642ab..b81b6a17cc 100644 --- a/scripting/scripting.cpp +++ b/scripting/scripting.cpp @@ -396,18 +396,19 @@ void KWin::Scripting::start() QFutureWatcher *watcher = new QFutureWatcher(this); connect(watcher, SIGNAL(finished()), this, SLOT(slotScriptsQueried())); KSharedConfig::Ptr _config = KGlobal::config(); - KConfigGroup conf(_config, "Plugins"); - watcher->setFuture(QtConcurrent::run(this, &KWin::Scripting::queryScriptsToLoad, conf)); + QMap pluginStates = KConfigGroup(_config, "Plugins").entryMap(); + watcher->setFuture(QtConcurrent::run(this, &KWin::Scripting::queryScriptsToLoad, pluginStates)); } -LoadScriptList KWin::Scripting::queryScriptsToLoad(KConfigGroup &conf) +LoadScriptList KWin::Scripting::queryScriptsToLoad(QMap &pluginStates) { KService::List offers = KServiceTypeTrader::self()->query("KWin/Script"); LoadScriptList scriptsToLoad; foreach (const KService::Ptr & service, offers) { KPluginInfo plugininfo(service); - plugininfo.load(conf); + const QString value = pluginStates.value(plugininfo.pluginName() + QString::fromLatin1("Enabled"), QString()); + plugininfo.setPluginEnabled(value.isNull() ? plugininfo.isPluginEnabledByDefault() : QVariant(value).toBool()); const bool javaScript = service->property("X-Plasma-API").toString() == "javascript"; const bool declarativeScript = service->property("X-Plasma-API").toString() == "declarativescript"; if (!javaScript && !declarativeScript) { diff --git a/scripting/scripting.h b/scripting/scripting.h index 663bbaccc1..9d728df456 100644 --- a/scripting/scripting.h +++ b/scripting/scripting.h @@ -208,7 +208,7 @@ private Q_SLOTS: void slotScriptsQueried(); private: - LoadScriptList queryScriptsToLoad(KConfigGroup &conf); + LoadScriptList queryScriptsToLoad(QMap &pluginStates); }; }