KDE/kdelibs/khtml

Stephan Kulow coolo at kde.org
Fri Feb 9 12:44:53 GMT 2007


Am Freitag, 9. Februar 2007 13:40 schrieb David Faure:
> On Friday 09 February 2007, Stephan Kulow wrote:
> > Am Freitag, 9. Februar 2007 00:46 schrieb David Faure:
> > > SVN commit 631767 by dfaure:
> > >
> > > Oh please, please, don't use setGroup anymore.
>
> As wrong as using setGroup was, I then realized that this wasn't where the
> actual bug was. kmail's code is creating a KConfigGroup and then passing
> the kconfig object (not the group!) to the saveConfig methods. I fixed it
> but it will have to wait for the KConfigGroup::entryMap that added, so next
> monday. Still, this is a good way to spot abuses of setGroup :)
>
> > Perhaps we should get rid of this function (or make it private so only
> > friends can set groups)? I'd favor an API that puts less focus on the
> > file and more on the groups.
>
> Yes, me too. But when the code is like
> KConfig cfg("foo");
> cfg.setGroup("blah");
> cfg.writeEntry(...);
> then there's nothing wrong with the code, of course.
>
> Still, we could port it to KConfigGroup, it would take the same amount of
> lines.
>
> As a first step I would simply add a KDE_DEPRECATED to setGroup.
> But there's a lot of code to convert - and the kconfig-branch people
> (including Aaron?) might have other plans with the api, too.
I guess, kde-core-devel might be the better audience then :)

Is there any reason to stick with setGroup (being public)?

Greetings, Stephan




More information about the kde-core-devel mailing list