Reparse configuration before (un)loading scripts

When the scripting KCM triggered a loading of a script it did not work
because the scripting code was operating on an old data set.

Reparsing the configuration before evaluating which scripts to (un)load
solves this problem.

REVIEW: 110357
BUG: 319767
FIXED-IN: 4.10.4
This commit is contained in:
Martin Gräßlin 2013-05-08 10:45:45 +02:00
parent e49290a016
commit f04be6b149

View file

@ -607,6 +607,12 @@ void KWin::Scripting::start()
LoadScriptList KWin::Scripting::queryScriptsToLoad() LoadScriptList KWin::Scripting::queryScriptsToLoad()
{ {
KSharedConfig::Ptr _config = KGlobal::config(); KSharedConfig::Ptr _config = KGlobal::config();
static bool s_started = false;
if (s_started) {
_config->reparseConfiguration();
} else {
s_started = true;
}
QMap<QString,QString> pluginStates = KConfigGroup(_config, "Plugins").entryMap(); QMap<QString,QString> pluginStates = KConfigGroup(_config, "Plugins").entryMap();
KService::List offers = KServiceTypeTrader::self()->query("KWin/Script"); KService::List offers = KServiceTypeTrader::self()->query("KWin/Script");