From 3b6d52549dc69df6db085efa5a348dee72b15918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sat, 2 Jun 2012 09:33:25 +0200 Subject: [PATCH] don't use kconfiggroup in threaded script loading at all BUG: 300934 FIXED-IN: 4.9 REVIEW: 105128 --- scripting/scripting.cpp | 9 +++++---- scripting/scripting.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) 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); }; }