[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Idea: SkipDirtyOnIdenticalValues WriteConfigFlag for KConfigBase
From:       David Faure <faure () kde ! org>
Date:       2008-06-04 8:46:04
Message-ID: 200806041046.05011.faure () kde ! org
[Download RAW message or body]

On Saturday 24 May 2008, Oswald Buddenhagen wrote:
> it will not write a config when the
> set value is the same as the default, while it should write the value
> explicitly so the effective config does not change when the default
> changes.

... and this is exactly why you need a flag, isn't it? :-)
In some cases you want the effective config to be stored, and in some
cases you want to use the default value, even if it changes later.
An example of the latter is the toolbar settings: if you set "text position"
of a toolbar back to "icon only", and that's your default, we want to write 
nothing in the config file so that if you change the default later, it will indeed
apply (instead of "most toolbars switched, but a few refused to switch to the new \
setting"). This is currently done in KToolBar with
  if ( !cg.hasDefault( "Position" ) && position == d->PositionDefault )
    cg.revertToDefault( "Position" );
  else
    cg.writeEntry( "Position", position );

Hmm, it looks like what this would need is a cg.writeEntry( "Position", position, \
d->PositionDefault ), in fact :-)

-- 
David Faure, faure@kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic