From c1c883a8a71529a94ede2b85023c5b5470255caf Mon Sep 17 00:00:00 2001 From: Arthur Arlt Date: Wed, 13 Jul 2011 11:36:49 +0200 Subject: [PATCH] Introduce new signal configChanged() to Workspace To get rid of direct method calls and numerous #ifdefs a new signal configChanged() is introduced to class Workspace. Every module which is interested in reloading the configuration is needed to connect to this signal. Initially this is done for the reconfiguration of DesktopChangeOSD(). --- desktopchangeosd.cpp | 1 + desktopchangeosd.h | 3 +-- workspace.cpp | 4 +--- workspace.h | 1 + 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/desktopchangeosd.cpp b/desktopchangeosd.cpp index 357b21c76b..04eac921f4 100644 --- a/desktopchangeosd.cpp +++ b/desktopchangeosd.cpp @@ -65,6 +65,7 @@ DesktopChangeOSD::DesktopChangeOSD(Workspace* ws) connect(&m_delayedHideTimer, SIGNAL(timeout()), this, SLOT(hide())); connect(ws, SIGNAL(currentDesktopChanged(int)), this, SLOT(desktopChanged(int))); connect(ws, SIGNAL(numberDesktopsChanged(int)), this, SLOT(numberDesktopsChanged())); + connect(ws, SIGNAL(configChanged()), this, SLOT(reconfigure())); m_scene = new QGraphicsScene(0); setScene(m_scene); diff --git a/desktopchangeosd.h b/desktopchangeosd.h index 4a9d1dee69..9c75205afd 100644 --- a/desktopchangeosd.h +++ b/desktopchangeosd.h @@ -70,8 +70,6 @@ public: DesktopChangeOSD(Workspace* ws); ~DesktopChangeOSD(); - void reconfigure(); - inline Plasma::FrameSvg* itemFrame() { return &m_item_frame; }; @@ -98,6 +96,7 @@ private: private Q_SLOTS: void desktopChanged(int old); void numberDesktopsChanged(); + void reconfigure(); }; class DesktopChangeItem : public QObject, public QGraphicsItem diff --git a/workspace.cpp b/workspace.cpp index 96d68a02b1..18e2173f2e 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -933,9 +933,7 @@ void Workspace::slotReconfigure() #ifdef KWIN_BUILD_TABBOX tab_box->reconfigure(); #endif -#ifdef KWIN_BUILD_DESKTOPCHANGEOSD - desktop_change_osd->reconfigure(); -#endif + emit configChanged(); initPositioning->reinitCascading(0); discardPopup(); forEachClient(CheckIgnoreFocusStealingProcedure()); diff --git a/workspace.h b/workspace.h index eddcf00190..fa3d7bdaba 100644 --- a/workspace.h +++ b/workspace.h @@ -718,6 +718,7 @@ signals: Qt::MouseButtons buttons, Qt::MouseButtons oldbuttons, Qt::KeyboardModifiers modifiers, Qt::KeyboardModifiers oldmodifiers); void propertyNotify(long a); + void configChanged(); private: void init();