From 95c8da25e6f4897dfd67ba3a4fdc7ad190c1690c Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Wed, 14 Apr 2010 22:35:46 +0000 Subject: [PATCH] made shadow cache mode configurable svn path=/trunk/KDE/kdebase/workspace/; revision=1114942 --- clients/oxygen/oxygenconfiguration.cpp | 30 ++++++++++++++++++++++++++ clients/oxygen/oxygenconfiguration.h | 8 ++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/clients/oxygen/oxygenconfiguration.cpp b/clients/oxygen/oxygenconfiguration.cpp index 63d94e27e6..4bea396de2 100644 --- a/clients/oxygen/oxygenconfiguration.cpp +++ b/clients/oxygen/oxygenconfiguration.cpp @@ -132,6 +132,10 @@ namespace Oxygen OxygenConfig::NARROW_BUTTON_SPACING, defaultConfiguration.useNarrowButtonSpacing() ) ); + // shadow cache mode + setShadowCacheMode( shadowCacheMode( group.readEntry( + OxygenConfig::SHADOW_CACHE_MODE, defaultConfiguration.shadowCacheModeName( false ) ), false ) ); + } //__________________________________________________ @@ -154,6 +158,7 @@ namespace Oxygen group.writeEntry( OxygenConfig::ANIMATIONS_DURATION, animationsDuration() ); group.writeEntry( OxygenConfig::TABS_ENABLED, tabsEnabled() ); group.writeEntry( OxygenConfig::NARROW_BUTTON_SPACING, useNarrowButtonSpacing() ); + group.writeEntry( OxygenConfig::SHADOW_CACHE_MODE, shadowCacheModeName( false ) ); } @@ -329,4 +334,29 @@ namespace Oxygen } + //__________________________________________________ + QString OxygenConfiguration::shadowCacheModeName( ShadowCacheMode value, bool translated ) + { + QString out; + switch( value ) + { + case CacheDisabled: out = translated ? i18n( "Disabled" ):"Disabled"; break; + case CacheVariable: out = translated ? i18n( "Variable" ):"Variable"; break; + case CacheMaximum: out = translated ? i18n( "Maximum" ):"Maximum"; break; + default: return OxygenConfiguration().shadowCacheModeName( translated ); + } + + return out; + + } + + //__________________________________________________ + OxygenConfiguration::ShadowCacheMode OxygenConfiguration::shadowCacheMode( QString value, bool translated ) + { + if( value == shadowCacheModeName( CacheDisabled, translated ) ) return CacheDisabled; + else if( value == shadowCacheModeName( CacheVariable, translated ) ) return CacheVariable; + else if( value == shadowCacheModeName( CacheMaximum, translated ) ) return CacheMaximum; + else return OxygenConfiguration().shadowCacheMode(); + } + } diff --git a/clients/oxygen/oxygenconfiguration.h b/clients/oxygen/oxygenconfiguration.h index 8a2fb0b1c3..e89d5b1629 100644 --- a/clients/oxygen/oxygenconfiguration.h +++ b/clients/oxygen/oxygenconfiguration.h @@ -46,7 +46,7 @@ namespace OxygenConfig static const QString ANIMATIONS_DURATION = "AnimationsDuration"; static const QString TABS_ENABLED = "TabsEnabled"; static const QString NARROW_BUTTON_SPACING = "UseNarrowButtonSpacing"; - + static const QString SHADOW_CACHE_MODE = "ShadowCacheMode"; } namespace Oxygen @@ -173,6 +173,12 @@ namespace Oxygen //!@name cache mode //@{ + static QString shadowCacheModeName( ShadowCacheMode, bool translated ); + static ShadowCacheMode shadowCacheMode( QString, bool translated ); + + QString shadowCacheModeName( bool translated ) const + { return shadowCacheModeName( shadowCacheMode(), translated ); } + void setShadowCacheMode( ShadowCacheMode mode ) { shadowCacheMode_ = mode; }