diff --git a/clients/oxygen/demo/oxygenshadowdemodialog.cpp b/clients/oxygen/demo/oxygenshadowdemodialog.cpp index 9e1481cab4..67e5cb1302 100644 --- a/clients/oxygen/demo/oxygenshadowdemodialog.cpp +++ b/clients/oxygen/demo/oxygenshadowdemodialog.cpp @@ -39,7 +39,7 @@ namespace Oxygen //_________________________________________________________ ShadowDemoDialog::ShadowDemoDialog( QWidget* parent ): QDialog( parent ), - _helper(), + _helper( KSharedConfig::openConfig("oxygenrc") ), _cache( _helper ) { diff --git a/clients/oxygen/oxygendecohelper.cpp b/clients/oxygen/oxygendecohelper.cpp index e6bbcbf9df..bd623a24bd 100644 --- a/clients/oxygen/oxygendecohelper.cpp +++ b/clients/oxygen/oxygendecohelper.cpp @@ -30,8 +30,8 @@ namespace Oxygen { //______________________________________________________________________________ - DecoHelper::DecoHelper(): - Helper() + DecoHelper::DecoHelper(KSharedConfigPtr config): + Helper(config) {} //______________________________________________________________________________ diff --git a/clients/oxygen/oxygendecohelper.h b/clients/oxygen/oxygendecohelper.h index 4c9a44ab54..00fde1fcbd 100644 --- a/clients/oxygen/oxygendecohelper.h +++ b/clients/oxygen/oxygendecohelper.h @@ -23,6 +23,7 @@ */ #include "oxygenhelper.h" +#include //! helper class /*! contains utility functions used at multiple places in oxygen style */ @@ -35,7 +36,7 @@ namespace Oxygen public: //! constructor - explicit DecoHelper(); + explicit DecoHelper(KSharedConfigPtr config); //! destructor virtual ~DecoHelper() diff --git a/clients/oxygen/oxygenfactory.cpp b/clients/oxygen/oxygenfactory.cpp index 6d5b08b916..2f44a6a16d 100644 --- a/clients/oxygen/oxygenfactory.cpp +++ b/clients/oxygen/oxygenfactory.cpp @@ -43,7 +43,8 @@ namespace Oxygen Factory::Factory(QObject *parent): KDecorationFactory(parent), _initialized( false ), - _helper(), + _config( KSharedConfig::openConfig( QStringLiteral("oxygenrc") ) ), + _helper( _config ), _shadowCache( _helper ) { readConfig(); @@ -71,26 +72,23 @@ namespace Oxygen //___________________________________________________ void Factory::readConfig() { - /* always reload helper this is needed to properly handle color contrast settings changed */ + _config->reparseConfiguration(); // could be skipped on startup helper().invalidateCaches(); - helper().reloadConfig(); + helper().loadConfig(); // initialize default configuration and read if( !_defaultConfiguration ) _defaultConfiguration = ConfigurationPtr(new Configuration()); _defaultConfiguration->setCurrentGroup( QStringLiteral("Windeco") ); _defaultConfiguration->readConfig(); - // create a config object - KSharedConfig::Ptr config( KSharedConfig::openConfig( QStringLiteral("oxygenrc") ) ); - // clear exceptions and read ExceptionList exceptions; - exceptions.readConfig( config ); + exceptions.readConfig( _config ); _exceptions = exceptions.get(); // read shadowCache configuration @@ -99,7 +97,7 @@ namespace Oxygen // background pixmap { - KConfigGroup group( config->group("Common") ); + KConfigGroup group( _config->group("Common") ); helper().setBackgroundPixmap( group.readEntry( "BackgroundPixmap", "" ) ); } diff --git a/clients/oxygen/oxygenfactory.h b/clients/oxygen/oxygenfactory.h index 9ed90ec156..a64f832b0a 100644 --- a/clients/oxygen/oxygenfactory.h +++ b/clients/oxygen/oxygenfactory.h @@ -129,6 +129,9 @@ namespace Oxygen //! list of exceptiosn QList _exceptions; + //! config object + KSharedConfigPtr _config; + }; }