KConfigGroup automatic sync

Sebastian Trüg trueg at kde.org
Wed Feb 18 16:23:40 GMT 2009


On Wednesday 18 February 2009 17:11:48 Stephan Kulow wrote:
> Am Mittwoch 18 Februar 2009 schrieb Sebastian Trüg:
> > The techbase article on KConfig states that the KConfigGroup destructor
> > will sync automatically:
> >
> > "We can also simply wait for the object to be destroyed, which triggers
> > an automatic sync() if necessary."
> >
> > This is not the case. Question is: what is the preferred behaviour?
> > Should it sync automatically or not? In the latter case, one would have
> > to call sync whenever one uses a group for writing which is very
> > annoying.
>
> syncing is a very expensive operation and KConfigGroup an often created
> object, so definitely: change the article. KConfigBase destructors should

Ok, so code like the following cannot be used then:

config->group("my group").writeEntry( "foobar", "hello world" );

?

> sync though, no idea if they do atm.

no, they don't since sync is pure virtual.




More information about the kde-core-devel mailing list