move KServiceTypeTrader::query() to main thread
KConfigGroup is not the least thread safe and unfortunately the KServiceTypeTrader::self()->query() will in doubt create one if the sycoca database was damaged. BUG: 303713 REVIEW: 105608
This commit is contained in:
parent
ff1ba460ec
commit
6a934502b8
2 changed files with 5 additions and 4 deletions
|
@ -475,12 +475,12 @@ void KWin::Scripting::start()
|
|||
connect(watcher, SIGNAL(finished()), this, SLOT(slotScriptsQueried()));
|
||||
KSharedConfig::Ptr _config = KGlobal::config();
|
||||
QMap<QString,QString> pluginStates = KConfigGroup(_config, "Plugins").entryMap();
|
||||
watcher->setFuture(QtConcurrent::run(this, &KWin::Scripting::queryScriptsToLoad, pluginStates));
|
||||
KService::List offers = KServiceTypeTrader::self()->query("KWin/Script");
|
||||
watcher->setFuture(QtConcurrent::run(this, &KWin::Scripting::queryScriptsToLoad, pluginStates, offers));
|
||||
}
|
||||
|
||||
LoadScriptList KWin::Scripting::queryScriptsToLoad(QMap<QString,QString> &pluginStates)
|
||||
LoadScriptList KWin::Scripting::queryScriptsToLoad(QMap<QString,QString> &pluginStates, KService::List &offers)
|
||||
{
|
||||
KService::List offers = KServiceTypeTrader::self()->query("KWin/Script");
|
||||
LoadScriptList scriptsToLoad;
|
||||
|
||||
foreach (const KService::Ptr & service, offers) {
|
||||
|
|
|
@ -23,6 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#define KWIN_SCRIPTING_H
|
||||
|
||||
#include <kwinglobals.h>
|
||||
#include <kservice.h>
|
||||
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QHash>
|
||||
|
@ -213,7 +214,7 @@ private Q_SLOTS:
|
|||
void slotScriptsQueried();
|
||||
|
||||
private:
|
||||
LoadScriptList queryScriptsToLoad(QMap<QString,QString> &pluginStates);
|
||||
LoadScriptList queryScriptsToLoad(QMap<QString,QString> &pluginStates, KService::List &);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue