diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index 9af950c4e4..4e9b435cee 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -1,8 +1,14 @@ +set(kwin_xml ${CMAKE_SOURCE_DIR}/workspace/kwin/org.kde.KWin.xml) + +set(interface_file) + +QT4_ADD_DBUS_INTERFACE( interface_file ${kwin_xml} kwin_interface ) ########### next target ############### -set(kwin_update_window_settings_SRCS update_window_settings.cpp) +set(kwin_update_window_settings_SRCS update_window_settings.cpp ${interface_file}) + kde4_automoc(${kwin_update_window_settings_SRCS}) @@ -14,7 +20,7 @@ install(TARGETS kwin_update_window_settings DESTINATION ${LIB_INSTALL_DIR}/kconf ########### next target ############### -set(kwin_update_default_rules_SRCS update_default_rules.cpp) +set(kwin_update_default_rules_SRCS update_default_rules.cpp ${interface_file}) kde4_automoc(${kwin_update_default_rules}) diff --git a/data/update_default_rules.cpp b/data/update_default_rules.cpp index e064aee726..3c74223bb6 100644 --- a/data/update_default_rules.cpp +++ b/data/update_default_rules.cpp @@ -15,6 +15,7 @@ License. See the file "COPYING" for the exact licensing terms. #include #include #include +#include int main( int argc, char* argv[] ) { @@ -54,6 +55,6 @@ int main( int argc, char* argv[] ) #warning D-BUS TODO // kwin* , and an attach to dbus is missing as well #endif - QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" ); - kwin.call( "reconfigure" ); + org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus()); + kwin.reconfigure(); } diff --git a/data/update_window_settings.cpp b/data/update_window_settings.cpp index 64f7ea2499..8ada432af6 100644 --- a/data/update_window_settings.cpp +++ b/data/update_window_settings.cpp @@ -17,7 +17,7 @@ License. See the file "COPYING" for the exact licensing terms. #include #include #include - +#include struct SessionInfo { QByteArray sessionId; @@ -171,6 +171,6 @@ int main() #warning D-BUS TODO // kwin* , and an attach to dbus is missing as well #endif - QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" ); - kwin.call( "reconfigure" ); + org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus()); + kwin.reconfigure(); } diff --git a/kcmkwin/kwindecoration/CMakeLists.txt b/kcmkwin/kwindecoration/CMakeLists.txt index eaf5a8707f..2bed465fa3 100644 --- a/kcmkwin/kwindecoration/CMakeLists.txt +++ b/kcmkwin/kwindecoration/CMakeLists.txt @@ -5,6 +5,11 @@ include_directories( ${CMAKE_SOURCE_DIR}/workspace/kwin/lib ) set(kcm_kwindecoration_PART_SRCS kwindecoration.cpp buttons.cpp preview.cpp ) +set(kwin_xml ${CMAKE_SOURCE_DIR}/workspace/kwin/org.kde.KWin.xml) + +QT4_ADD_DBUS_INTERFACE( kcm_kwindecoration_PART_SRCS ${kwin_xml} kwin_interface ) + + kde4_automoc(${kcm_kwindecoration_PART_SRCS}) diff --git a/kcmkwin/kwindecoration/kwindecoration.cpp b/kcmkwin/kwindecoration/kwindecoration.cpp index 9a3878929c..6c82c9c51c 100644 --- a/kcmkwin/kwindecoration/kwindecoration.cpp +++ b/kcmkwin/kwindecoration/kwindecoration.cpp @@ -62,6 +62,7 @@ #include #include #include +#include // KCModule plugin interface // ========================= @@ -531,8 +532,8 @@ void KWinDecorationModule::save() emit pluginSave( kwinConfig ); kwinConfig.sync(); - QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" ); - kwin.call( "reconfigure" ); + org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus()); + kwin.reconfigure(); } diff --git a/kcmkwin/kwinoptions/CMakeLists.txt b/kcmkwin/kwinoptions/CMakeLists.txt index a214bef109..4b7ea6e1ce 100644 --- a/kcmkwin/kwinoptions/CMakeLists.txt +++ b/kcmkwin/kwinoptions/CMakeLists.txt @@ -5,6 +5,10 @@ set(kcm_kwinoptions_PART_SRCS windows.cpp mouse.cpp main.cpp ) +set(kwin_xml ${CMAKE_SOURCE_DIR}/workspace/kwin/org.kde.KWin.xml) + +QT4_ADD_DBUS_INTERFACE( kcm_kwinoptions_PART_SRCS ${kwin_xml} kwin_interface ) + kde4_automoc(${kcm_kwinoptions_PART_SRCS}) kde4_add_plugin(kcm_kwinoptions ${kcm_kwinoptions_PART_SRCS}) diff --git a/kcmkwin/kwinoptions/main.cpp b/kcmkwin/kwinoptions/main.cpp index c28acb55d6..4cbf308323 100644 --- a/kcmkwin/kwinoptions/main.cpp +++ b/kcmkwin/kwinoptions/main.cpp @@ -33,7 +33,7 @@ #include "mouse.h" #include "windows.h" - +#include "kwin_interface.h" #include "main.h" static KComponentData *_kcmkwm = 0; @@ -184,8 +184,8 @@ void KWinOptions::save() #warning D-BUS TODO // All these calls in kcmkwin modules should be actually kwin*, because of multihead. #endif - QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" ); - kwin.call( "reconfigure" ); + org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus()); + kwin.reconfigure(); } @@ -260,8 +260,8 @@ void KActionsOptions::save() emit KCModule::changed( false ); // Send signal to kwin mConfig->sync(); - QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" ); - kwin.call( "reconfigure" ); + org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus()); + kwin.reconfigure(); } diff --git a/kcmkwin/kwinoptions/mouse.cpp b/kcmkwin/kwinoptions/mouse.cpp index 28d555f731..b4dd89e77e 100644 --- a/kcmkwin/kwinoptions/mouse.cpp +++ b/kcmkwin/kwinoptions/mouse.cpp @@ -47,7 +47,7 @@ #include "mouse.h" #include "mouse.moc" - +#include "kwin_interface.h" namespace { @@ -571,8 +571,8 @@ void KTitleBarActionsConfig::save() if (standAlone) { config->sync(); - QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" ); - kwin.call( "reconfigure" ); + org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus()); + kwin.reconfigure(); } } @@ -847,8 +847,8 @@ void KWindowActionsConfig::save() if (standAlone) { config->sync(); - QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" ); - kwin.call( "reconfigure" ); + org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus()); + kwin.reconfigure(); } } diff --git a/kcmkwin/kwinoptions/windows.cpp b/kcmkwin/kwinoptions/windows.cpp index 87f7ac8630..ec0bb15e82 100644 --- a/kcmkwin/kwinoptions/windows.cpp +++ b/kcmkwin/kwinoptions/windows.cpp @@ -55,7 +55,7 @@ #include #include "windows.h" - +#include "kwin_interface.h" // kwin config keywords #define KWIN_FOCUS "FocusPolicy" @@ -492,8 +492,8 @@ void KFocusConfig::save( void ) if (standAlone) { config->sync(); - QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" ); - kwin.call( "reconfigure" ); + org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus()); + kwin.reconfigure(); } emit KCModule::changed(false); } @@ -719,8 +719,8 @@ void KAdvancedConfig::save( void ) if (standAlone) { config->sync(); - QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" ); - kwin.call( "reconfigure" ); + org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus()); + kwin.reconfigure(); } emit KCModule::changed(false); } @@ -1183,8 +1183,8 @@ void KMovingConfig::save( void ) if (standAlone) { config->sync(); - QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" ); - kwin.call( "reconfigure" ); + org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus()); + kwin.reconfigure(); } emit KCModule::changed(false); } diff --git a/kcmkwin/kwinrules/CMakeLists.txt b/kcmkwin/kwinrules/CMakeLists.txt index 8801313b42..e39d743614 100644 --- a/kcmkwin/kwinrules/CMakeLists.txt +++ b/kcmkwin/kwinrules/CMakeLists.txt @@ -7,6 +7,11 @@ ADD_DEFINITIONS(-DKCMRULES) ########### next target ############### set(kwinrules_SRCS ruleswidget.cpp ruleslist.cpp kwinsrc.cpp detectwidget.cpp) + +set(kwin_xml ${CMAKE_SOURCE_DIR}/workspace/kwin/org.kde.KWin.xml) + +QT4_ADD_DBUS_INTERFACE( kwinrules_SRCS ${kwin_xml} kwin_interface ) + kde4_add_ui_files(kwinrules_SRCS ruleslistbase.ui detectwidgetbase.ui) kde4_add_ui3_files(kwinrules_SRCS ruleswidgetbase.ui editshortcutbase.ui ) diff --git a/kcmkwin/kwinrules/kcm.cpp b/kcmkwin/kwinrules/kcm.cpp index c516413a54..6178ef0c2d 100644 --- a/kcmkwin/kwinrules/kcm.cpp +++ b/kcmkwin/kwinrules/kcm.cpp @@ -29,6 +29,7 @@ #include #include "ruleslist.h" +#include "kwin_interface.h" typedef KGenericFactory KCMRulesFactory; K_EXPORT_COMPONENT_FACTORY(kwinrules, KCMRulesFactory("kcmkwinrules")) @@ -64,8 +65,8 @@ void KCMRules::save() emit KCModule::changed( false ); // Send signal to kwin config.sync(); - QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" ); - kwin.call( "reconfigure" ); + org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus()); + kwin.reconfigure(); } void KCMRules::defaults() diff --git a/kcmkwin/kwinrules/main.cpp b/kcmkwin/kwinrules/main.cpp index b1442733dc..48679fa644 100644 --- a/kcmkwin/kwinrules/main.cpp +++ b/kcmkwin/kwinrules/main.cpp @@ -22,7 +22,7 @@ #include #include #include - +#include #include #include @@ -256,8 +256,8 @@ static int edit( Window wid, bool whole_app ) delete orig_rule; } saveRules( rules ); - QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" ); - kwin.call( "reconfigure" ); + org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus()); + kwin.reconfigure(); return 0; }