Merging from old trunk:

r619161 | mlaurent | 2007-01-02 22:48:19 +0100 (Tue, 02 Jan 2007) | 2 lines

Use signal to refresh config into all kwin instance


svn path=/trunk/KDE/kdebase/workspace/; revision=659520
This commit is contained in:
Luboš Luňák 2007-04-30 11:32:47 +00:00
parent 76c7e1445e
commit 047ad1b80a
13 changed files with 63 additions and 64 deletions

View file

@ -1,13 +1,9 @@
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 ${interface_file})
set(kwin_update_window_settings_SRCS update_window_settings.cpp )
kde4_automoc(${kwin_update_window_settings_SRCS})
@ -20,7 +16,7 @@ install(TARGETS kwin_update_window_settings DESTINATION ${LIB_INSTALL_DIR}/kconf
########### next target ###############
set(kwin_update_default_rules_SRCS update_default_rules.cpp ${interface_file})
set(kwin_update_default_rules_SRCS update_default_rules.cpp)
kde4_automoc(${kwin_update_default_rules})

View file

@ -15,7 +15,6 @@ License. See the file "COPYING" for the exact licensing terms.
#include <kcomponentdata.h>
#include <kstandarddirs.h>
#include <QtDBus/QtDBus>
#include <kwin_interface.h>
int main( int argc, char* argv[] )
{
@ -51,10 +50,9 @@ int main( int argc, char* argv[] )
dest_cfg.writeEntry( "count", pos );
src_cfg.sync();
dest_cfg.sync();
#ifdef __GNUC__
#warning D-BUS TODO
// kwin* , and an attach to dbus is missing as well
#endif
org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus());
kwin.reconfigure();
// Send signal to all kwin instances
QDBusMessage message =
QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
QDBusConnection::sessionBus().send(message);
}

View file

@ -17,7 +17,6 @@ License. See the file "COPYING" for the exact licensing terms.
#include <QByteArray>
#include <QList>
#include <QtDBus/QtDBus>
#include <kwin_interface.h>
struct SessionInfo
{
QByteArray sessionId;
@ -167,10 +166,8 @@ int main()
writeRules( dest_cfg );
src_cfg.sync();
dest_cfg.sync();
#ifdef __GNUC__
#warning D-BUS TODO
// kwin* , and an attach to dbus is missing as well
#endif
org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus());
kwin.reconfigure();
// Send signal to all kwin instances
QDBusMessage message =
QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
QDBusConnection::sessionBus().send(message);
}

View file

@ -5,10 +5,6 @@ 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})

View file

@ -62,7 +62,6 @@
#include <kdecoration_plugins_p.h>
#include <kdecorationfactory.h>
#include <kvbox.h>
#include <kwin_interface.h>
// KCModule plugin interface
// =========================
@ -532,8 +531,11 @@ void KWinDecorationModule::save()
emit pluginSave( kwinConfig );
kwinConfig.sync();
org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus());
kwin.reconfigure();
// Send signal to all kwin instances
QDBusMessage message =
QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
QDBusConnection::sessionBus().send(message);
}

View file

@ -5,9 +5,6 @@
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})

View file

@ -33,7 +33,6 @@
#include "mouse.h"
#include "windows.h"
#include "kwin_interface.h"
#include "main.h"
static KComponentData *_kcmkwm = 0;
@ -180,12 +179,12 @@ void KWinOptions::save()
emit KCModule::changed( false );
// Send signal to kwin
mConfig->sync();
#ifdef __GNUC__
#warning D-BUS TODO
// All these calls in kcmkwin modules should be actually kwin*, because of multihead.
#endif
org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus());
kwin.reconfigure();
// Send signal to all kwin instances
QDBusMessage message =
QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
QDBusConnection::sessionBus().send(message);
}
@ -260,8 +259,11 @@ void KActionsOptions::save()
emit KCModule::changed( false );
// Send signal to kwin
mConfig->sync();
org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus());
kwin.reconfigure();
// Send signal to all kwin instances
QDBusMessage message =
QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
QDBusConnection::sessionBus().send(message);
}

View file

@ -47,7 +47,6 @@
#include "mouse.h"
#include "mouse.moc"
#include "kwin_interface.h"
namespace {
@ -571,8 +570,11 @@ void KTitleBarActionsConfig::save()
if (standAlone)
{
config->sync();
org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus());
kwin.reconfigure();
// Send signal to all kwin instances
QDBusMessage message =
QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
QDBusConnection::sessionBus().send(message);
}
}
@ -847,8 +849,10 @@ void KWindowActionsConfig::save()
if (standAlone)
{
config->sync();
org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus());
kwin.reconfigure();
// Send signal to all kwin instances
QDBusMessage message =
QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
QDBusConnection::sessionBus().send(message);
}
}

View file

@ -55,7 +55,6 @@
#include <X11/Xutil.h>
#include "windows.h"
#include "kwin_interface.h"
// kwin config keywords
#define KWIN_FOCUS "FocusPolicy"
@ -492,8 +491,10 @@ void KFocusConfig::save( void )
if (standAlone)
{
config->sync();
org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus());
kwin.reconfigure();
// Send signal to all kwin instances
QDBusMessage message =
QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
QDBusConnection::sessionBus().send(message);
}
emit KCModule::changed(false);
}
@ -719,8 +720,11 @@ void KAdvancedConfig::save( void )
if (standAlone)
{
config->sync();
org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus());
kwin.reconfigure();
// Send signal to all kwin instances
QDBusMessage message =
QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
QDBusConnection::sessionBus().send(message);
}
emit KCModule::changed(false);
}
@ -1183,8 +1187,10 @@ void KMovingConfig::save( void )
if (standAlone)
{
config->sync();
org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus());
kwin.reconfigure();
// Send signal to all kwin instances
QDBusMessage message =
QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
QDBusConnection::sessionBus().send(message);
}
emit KCModule::changed(false);
}
@ -1587,8 +1593,11 @@ void KTranslucencyConfig::save( void )
if (standAlone)
{
config->sync();
org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus());
kwin.reconfigure();
// Send signal to all kwin instances
QDBusMessage message =
QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
QDBusConnection::sessionBus().send(message);
}
emit KCModule::changed(false);
}

View file

@ -8,10 +8,6 @@ ADD_DEFINITIONS(-DKCMRULES)
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 )

View file

@ -29,7 +29,6 @@
#include <QtDBus/QtDBus>
#include "ruleslist.h"
#include "kwin_interface.h"
typedef KGenericFactory<KWin::KCMRules> KCMRulesFactory;
K_EXPORT_COMPONENT_FACTORY(kwinrules, KCMRulesFactory("kcmkwinrules"))
@ -65,8 +64,11 @@ void KCMRules::save()
emit KCModule::changed( false );
// Send signal to kwin
config.sync();
org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus());
kwin.reconfigure();
// Send signal to all kwin instances
QDBusMessage message =
QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
QDBusConnection::sessionBus().send(message);
}
void KCMRules::defaults()

View file

@ -22,7 +22,6 @@
#include <klocale.h>
#include <kwm.h>
#include <QtDBus/QtDBus>
#include <kwin_interface.h>
#include <X11/Xlib.h>
#include <fixx11h.h>
@ -256,8 +255,10 @@ static int edit( Window wid, bool whole_app )
delete orig_rule;
}
saveRules( rules );
org::kde::KWin kwin("org.kde.kwin", "/KWin", QDBusConnection::sessionBus());
kwin.reconfigure();
// Send signal to all kwin instances
QDBusMessage message =
QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
QDBusConnection::sessionBus().send(message);
return 0;
}

View file

@ -134,7 +134,6 @@ Workspace::Workspace( bool restore )
QDBusConnection dbus = QDBusConnection::sessionBus();
dbus.registerObject("/KWin", this);
dbus.connect(QString(), "/KWin", "org.kde.KWin", "reloadConfig", this, SLOT(slotReloadConfig()));
_self = this;
mgr = new PluginMgr;
root = rootWindow();