From 36932d3f2e1f5c65af14b7fbc0bd95755ade299c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sun, 6 May 2012 19:20:38 +0200 Subject: [PATCH] Reload scripts after saving in scripts KCM DBus call to start scripting again. This should adjust the state of loaded scripts to the saved selection in the KPluginSelector. REVIEW: 104876 --- kcmkwin/kwinscripts/module.cpp | 8 +++++++- scripting/scripting.h | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/kcmkwin/kwinscripts/module.cpp b/kcmkwin/kwinscripts/module.cpp index 9e89cbbde0..8f8e076d4e 100644 --- a/kcmkwin/kwinscripts/module.cpp +++ b/kcmkwin/kwinscripts/module.cpp @@ -21,6 +21,9 @@ #include "ui_module.h" #include +#include +#include +#include #include #include @@ -96,6 +99,7 @@ void Module::updateListViewContents() void Module::defaults() { ui->scriptSelector->defaults(); + emit changed(true); } void Module::load() @@ -109,7 +113,9 @@ void Module::load() void Module::save() { ui->scriptSelector->save(); - // TODO: reload scripts in KWin + m_kwinConfig->sync(); + QDBusMessage message = QDBusMessage::createMethodCall("org.kde.kwin", "/Scripting", "org.kde.kwin.Scripting", "start"); + QDBusConnection::sessionBus().asyncCall(message); emit changed(false); } diff --git a/scripting/scripting.h b/scripting/scripting.h index 8d243d6979..663bbaccc1 100644 --- a/scripting/scripting.h +++ b/scripting/scripting.h @@ -202,7 +202,7 @@ public: public Q_SLOTS: void scriptDestroyed(QObject *object); - void start(); + Q_SCRIPTABLE void start(); private Q_SLOTS: void slotScriptsQueried();