From 3ba096c34e612ac552d3f011b1afcf8347fa9607 Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Sat, 28 Aug 2010 23:45:14 +0000 Subject: [PATCH] Tried rationalize configuration changes. svn path=/trunk/KDE/kdebase/workspace/; revision=1169281 --- clients/oxygen/oxygenfactory.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/clients/oxygen/oxygenfactory.cpp b/clients/oxygen/oxygenfactory.cpp index d58f89f6e4..8766568658 100644 --- a/clients/oxygen/oxygenfactory.cpp +++ b/clients/oxygen/oxygenfactory.cpp @@ -66,6 +66,12 @@ namespace Oxygen bool Factory::reset(unsigned long changed) { + if( changed & SettingColors ) + { + shadowCache().invalidateCaches(); + helper().invalidateCaches(); + } + // read in the configuration setInitialized( false ); bool configuration_changed = readConfig(); @@ -74,11 +80,13 @@ namespace Oxygen if( configuration_changed || (changed & (SettingDecoration | SettingButtons | SettingBorder)) ) { + // returning true triggers all decorations to be re-created return true; } else { - if( changed & SettingColors ) shadowCache().invalidateCaches(); + // no need to re-create the decorations + // trigger repaint only resetDecorations(changed); return false; @@ -112,6 +120,7 @@ namespace Oxygen // initialize shadow cache switch( defaultConfiguration().shadowCacheMode() ) { + case Configuration::CacheDisabled: { shadowCache_.setEnabled( false ); @@ -156,6 +165,7 @@ namespace Oxygen if( shadowCache().shadowConfigurationChanged( activeShadowConfiguration ) ) { shadowCache().setShadowConfiguration( activeShadowConfiguration ); + shadowCache().invalidateCaches(); changed = true; } @@ -165,17 +175,11 @@ namespace Oxygen if( shadowCache().shadowConfigurationChanged( inactiveShadowConfiguration ) ) { shadowCache().setShadowConfiguration( inactiveShadowConfiguration ); + shadowCache().invalidateCaches(); changed = true; } - if( changed ) - { - - shadowCache().invalidateCaches(); - helper().invalidateCaches(); - return true; - - } else return false; + return changed; }