use ShadowConfiguration::write() to write config to file.
Do not write options which have default value. This is consistent with what kconfigskeleton does. svn path=/trunk/KDE/kdebase/workspace/; revision=1208709
This commit is contained in:
parent
4840b07e22
commit
fd4c9ce6a7
2 changed files with 17 additions and 11 deletions
|
@ -183,13 +183,18 @@ namespace Oxygen
|
||||||
|
|
||||||
assert( colorGroup == QPalette::Active || colorGroup == QPalette::Inactive );
|
assert( colorGroup == QPalette::Active || colorGroup == QPalette::Inactive );
|
||||||
|
|
||||||
|
// create shadow configuration
|
||||||
|
ShadowConfiguration configuration( colorGroup );
|
||||||
|
configuration.setShadowSize( ui.ui.shadowSize->value() );
|
||||||
|
configuration.setHorizontalOffset( 0.1*ui.ui.verticalOffset->value() );
|
||||||
|
configuration.setInnerColor( ui.ui.innerColor->color() );
|
||||||
|
configuration.setOuterColor( ui.ui.outerColor->color() );
|
||||||
|
configuration.setUseOuterColor( ui.ui.useOuterColor->isChecked() );
|
||||||
|
|
||||||
// save shadow configuration
|
// save shadow configuration
|
||||||
KConfigGroup configurationGroup( configuration_, ( (colorGroup == QPalette::Active) ? "ActiveShadow":"InactiveShadow" ) );
|
KConfigGroup configurationGroup( configuration_, ( (colorGroup == QPalette::Active) ? "ActiveShadow":"InactiveShadow" ) );
|
||||||
configurationGroup.writeEntry( OxygenConfig::SHADOW_SIZE, ui.ui.shadowSize->value() );
|
configurationGroup.deleteGroup();
|
||||||
configurationGroup.writeEntry( OxygenConfig::SHADOW_VOFFSET, 0.1*ui.ui.verticalOffset->value() );
|
configuration.write( configurationGroup );
|
||||||
configurationGroup.writeEntry( OxygenConfig::SHADOW_INNER_COLOR, ui.ui.innerColor->color() );
|
|
||||||
configurationGroup.writeEntry( OxygenConfig::SHADOW_OUTER_COLOR, ui.ui.outerColor->color() );
|
|
||||||
configurationGroup.writeEntry( OxygenConfig::SHADOW_USE_OUTER_COLOR, ui.ui.useOuterColor->isChecked() );
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,12 +92,13 @@ namespace Oxygen
|
||||||
//_________________________________________________________
|
//_________________________________________________________
|
||||||
void ShadowConfiguration::write( KConfigGroup& group ) const
|
void ShadowConfiguration::write( KConfigGroup& group ) const
|
||||||
{
|
{
|
||||||
group.writeEntry( OxygenConfig::SHADOW_SIZE, shadowSize() );
|
ShadowConfiguration defaultConfiguration( colorGroup_ );
|
||||||
group.writeEntry( OxygenConfig::SHADOW_HOFFSET, horizontalOffset() );
|
if( shadowSize() != defaultConfiguration.shadowSize() ) group.writeEntry( OxygenConfig::SHADOW_SIZE, shadowSize() );
|
||||||
group.writeEntry( OxygenConfig::SHADOW_VOFFSET, verticalOffset() );
|
if( horizontalOffset() != defaultConfiguration.horizontalOffset() ) group.writeEntry( OxygenConfig::SHADOW_HOFFSET, horizontalOffset() );
|
||||||
group.writeEntry( OxygenConfig::SHADOW_INNER_COLOR, innerColor().name() );
|
if( verticalOffset() != defaultConfiguration.verticalOffset() ) group.writeEntry( OxygenConfig::SHADOW_VOFFSET, verticalOffset() );
|
||||||
group.writeEntry( OxygenConfig::SHADOW_OUTER_COLOR, outerColor().name() );
|
if( innerColor() != defaultConfiguration.innerColor() ) group.writeEntry( OxygenConfig::SHADOW_INNER_COLOR, innerColor().name() );
|
||||||
group.writeEntry( OxygenConfig::SHADOW_USE_OUTER_COLOR, useOuterColor() );
|
if( outerColor() != defaultConfiguration.outerColor() ) group.writeEntry( OxygenConfig::SHADOW_OUTER_COLOR, outerColor().name() );
|
||||||
|
if( useOuterColor() != defaultConfiguration.useOuterColor() ) group.writeEntry( OxygenConfig::SHADOW_USE_OUTER_COLOR, useOuterColor() );
|
||||||
}
|
}
|
||||||
|
|
||||||
//_________________________________________________________
|
//_________________________________________________________
|
||||||
|
|
Loading…
Reference in a new issue