diff --git a/scripting/scripting.cpp b/scripting/scripting.cpp index 3405a410bf..a06f77d7fe 100644 --- a/scripting/scripting.cpp +++ b/scripting/scripting.cpp @@ -294,14 +294,13 @@ void KWin::Scripting::start() // perform querying for the services in a thread QFutureWatcher *watcher = new QFutureWatcher(this); connect(watcher, SIGNAL(finished()), this, SLOT(slotScriptsQueried())); - watcher->setFuture(QtConcurrent::run(this, &KWin::Scripting::queryScriptsToLoad)); -} - -LoadScriptList KWin::Scripting::queryScriptsToLoad() -{ KSharedConfig::Ptr _config = KGlobal::config(); KConfigGroup conf(_config, "Plugins"); + watcher->setFuture(QtConcurrent::run(this, &KWin::Scripting::queryScriptsToLoad, conf)); +} +LoadScriptList KWin::Scripting::queryScriptsToLoad(KConfigGroup &conf) +{ KService::List offers = KServiceTypeTrader::self()->query("KWin/Script"); LoadScriptList scriptsToLoad; diff --git a/scripting/scripting.h b/scripting/scripting.h index d445635251..ce71355687 100644 --- a/scripting/scripting.h +++ b/scripting/scripting.h @@ -185,7 +185,7 @@ private Q_SLOTS: void slotScriptsQueried(); private: - LoadScriptList queryScriptsToLoad(); + LoadScriptList queryScriptsToLoad(KConfigGroup &conf); }; }