[RFC] KConfig API stuff

Oswald Buddenhagen ossi at kde.org
Mon Oct 22 14:20:08 BST 2007


On Mon, Oct 22, 2007 at 02:53:52PM +0200, David Faure wrote:
> But I think that having to get to a group (explicitely, not via
> KConfig itself) before reading/writing is actually quite consistent.
> 
actually, it is not. to be consistent, you'd have to write it like this:

KConfig().rootGroup();
KConfig().rootGroup().group("group1");
KConfig().rootGroup().group("group1").group("gorup2");

really, trivial tree theory ...

> > > I already see all the newbie-written kde4 apps using KConfig only and 
> > > thus writing everything into the root group.... ugly.
> > > 
> > you're making up a problem here. it's a documentation issue. 
> Yeah, we all know how much people read documentation :-)
>
well, one has to read some of the docs anyway to get started. or read
some examples, which pretty surely will do the right thing.

> > > I thought you said "too much porting effort, it will remain, but deprecated"?
> > >
> > i said that about KConfigGroup::changeGroup(). KConfig::setGroup() is
> > virtually unused these days (and not to influence reads/writes anyway,
> > as this currently works only via KConfigGroup, obviously).
> 
> And here again, when you say unused, you mean in SVN.
> As long as the method exists, kde3 code (out of SVN) that will be ported 
> to kde4 in the future, will compile, and will work wrongly. That is a huge problem.
> 
no, it's not, because setGroup() won't exist. the old code will simply
not compile, just like it does now. this also makes the "kde3
experience" argument fall flat.

> > > Viewing config as a tree is a good reason for having a root group
> > > indeed, but it is not a reason for KConfig being the root group
> > > itself.
> > > 
> > it is. if you don't do it, you introduce special cases for things
> > that are no special cases in fact.
> 
> There is no special case in the sentence "you need a group to be able
> to read and write".
> 
there is a special case in the sentence "you need as many groups as
deeply as your hierarchy is nested, but wait, you still need a group
when you want to access the root level".

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
--
Chaos, panic, and disorder - my work here is done.




More information about the kde-core-devel mailing list