From 287ddf8446a8c27969ee9c7242a6cfa4c409c7d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 23 Aug 2013 15:26:53 +0200 Subject: [PATCH] Remove reset method from OxygenClient Connects to the appropriate changed signals instead. --- clients/oxygen/oxygenclient.cpp | 23 +++++++++++++++-------- clients/oxygen/oxygenclient.h | 7 ++++--- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/clients/oxygen/oxygenclient.cpp b/clients/oxygen/oxygenclient.cpp index b8ae069a43..059a8f0d30 100644 --- a/clients/oxygen/oxygenclient.cpp +++ b/clients/oxygen/oxygenclient.cpp @@ -67,7 +67,10 @@ namespace Oxygen _itemData( this ), _sourceItem( -1 ), _shadowAtom( 0 ) - {} + { + connect(options(), &KDecorationOptions::compositingChanged, this, &Client::updateCompositing); + connect(options(), &KDecorationOptions::configChanged, this, &Client::updateConfig); + } //___________________________________________ Client::~Client() @@ -133,20 +136,24 @@ namespace Oxygen _initialized = true; // first reset is needed to store Oxygen configuration - reset(0); + updateConfig(); } //___________________________________________ - void Client::reset( unsigned long changed ) + void Client::updateCompositing() { // update window mask when compositing is changed if( !_initialized ) return; - if( changed & SettingCompositing ) - { - updateWindowShape(); - widget()->update(); - } + updateWindowShape(); + widget()->update(); + updateConfig(); + } + + //___________________________________________ + void Client::updateConfig() + { + if( !_initialized ) return; _configuration = _factory->configuration( *this ); diff --git a/clients/oxygen/oxygenclient.h b/clients/oxygen/oxygenclient.h index 11bdd1152d..dfa1dfcadc 100644 --- a/clients/oxygen/oxygenclient.h +++ b/clients/oxygen/oxygenclient.h @@ -127,9 +127,6 @@ namespace Oxygen //! initialization virtual void init(); - // reset - virtual void reset( unsigned long changed ); - //! return associated configuration Factory::ConfigurationPtr configuration( void ) const { return _configuration; } @@ -435,6 +432,10 @@ namespace Oxygen //! bound one rect to another void boundRectTo( QRect&, const QRect& ) const; + private Q_SLOTS: + void updateCompositing(); + void updateConfig(); + private: //! factory