KConfigGroup automatic sync

Stephan Kulow coolo at suse.de
Wed Feb 18 16:26:38 GMT 2009


Am Mittwoch 18 Februar 2009 schrieb Sebastian Trüg:
> 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" );
>
Sure it can be used. But it shouldn't sync.

Greetings, Stephan






More information about the kde-core-devel mailing list