kconfig sync at exit

Thomas Zander zander at kde.org
Wed Jun 20 20:31:25 BST 2007


On Wednesday 20 June 2007 21:04:53 Aaron J. Seigo wrote:
> On Wednesday 20 June 2007, Thomas Zander wrote:
> > I was surprised to see that I had to manually call 'config->sync()'
> > afterwards since none of my changes (not even the new group) appeared
> > in the config due to the app quitting shortly after.
>
> this is a regression somewhere... KConfig::~KConfig() does indeed call
> sync(), but that relies on the config being marked dirty. so somewhere
> ... that's not happening.
>
> are you using kconfiggroup or directly callin kconfig{base} methods?

    KSharedConfigPtr config = KGlobal::config();
    KConfigGroup interface = config->group( "Interface" );
    interface.writeEntry( "Zoom", m_zoom );
    config->sync();  // do we need this line?

I'm not aware of any other way to do it ;)

-- 
Thomas Zander
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070620/f30b6f00/attachment.sig>


More information about the kde-core-devel mailing list