Tried rationalize configuration changes.

svn path=/trunk/KDE/kdebase/workspace/; revision=1169281
This commit is contained in:
Hugo Pereira Da Costa 2010-08-28 23:45:14 +00:00
parent 2947ec516b
commit 3ba096c34e

View file

@ -66,6 +66,12 @@ namespace Oxygen
bool Factory::reset(unsigned long changed) bool Factory::reset(unsigned long changed)
{ {
if( changed & SettingColors )
{
shadowCache().invalidateCaches();
helper().invalidateCaches();
}
// read in the configuration // read in the configuration
setInitialized( false ); setInitialized( false );
bool configuration_changed = readConfig(); bool configuration_changed = readConfig();
@ -74,11 +80,13 @@ namespace Oxygen
if( configuration_changed || (changed & (SettingDecoration | SettingButtons | SettingBorder)) ) if( configuration_changed || (changed & (SettingDecoration | SettingButtons | SettingBorder)) )
{ {
// returning true triggers all decorations to be re-created
return true; return true;
} else { } else {
if( changed & SettingColors ) shadowCache().invalidateCaches(); // no need to re-create the decorations
// trigger repaint only
resetDecorations(changed); resetDecorations(changed);
return false; return false;
@ -112,6 +120,7 @@ namespace Oxygen
// initialize shadow cache // initialize shadow cache
switch( defaultConfiguration().shadowCacheMode() ) switch( defaultConfiguration().shadowCacheMode() )
{ {
case Configuration::CacheDisabled: case Configuration::CacheDisabled:
{ {
shadowCache_.setEnabled( false ); shadowCache_.setEnabled( false );
@ -156,6 +165,7 @@ namespace Oxygen
if( shadowCache().shadowConfigurationChanged( activeShadowConfiguration ) ) if( shadowCache().shadowConfigurationChanged( activeShadowConfiguration ) )
{ {
shadowCache().setShadowConfiguration( activeShadowConfiguration ); shadowCache().setShadowConfiguration( activeShadowConfiguration );
shadowCache().invalidateCaches();
changed = true; changed = true;
} }
@ -165,17 +175,11 @@ namespace Oxygen
if( shadowCache().shadowConfigurationChanged( inactiveShadowConfiguration ) ) if( shadowCache().shadowConfigurationChanged( inactiveShadowConfiguration ) )
{ {
shadowCache().setShadowConfiguration( inactiveShadowConfiguration ); shadowCache().setShadowConfiguration( inactiveShadowConfiguration );
shadowCache().invalidateCaches();
changed = true; changed = true;
} }
if( changed ) return changed;
{
shadowCache().invalidateCaches();
helper().invalidateCaches();
return true;
} else return false;
} }