[PATCH] KConfig code cleanups

Oswald Buddenhagen ossi at kde.org
Sun Oct 28 22:31:10 GMT 2007


On Sun, Oct 28, 2007 at 01:39:17PM -0500, Thomas Braxton wrote:
> On 10/28/07, Oswald Buddenhagen <ossi at kde.org> wrote:
> > On Sat, Oct 27, 2007 at 05:07:10PM -0500, Thomas Braxton wrote:
> > > 1) do we want to support an empty group name?
> > > 2) this one depends on #1, should the name of the default group be
> > > exposed?
> > >
> > the concept of giving the root group a virtual name is bogus. it should
> > be a null string.
> > this, btw, does not mean that the name of the root group is "" - the
> > root group simply has no name, but we need to address it somehow through
> > our tree-wise inferior api. consequently, subgroups cannot have empty
> > names, either.
> 
> A couple of problems with what you wrote:
> 1) A group with an empty name does not have to be the <default> group, it
> would be written to an ini file as [].
>
that's bogus, too. what would it mean, logically? and i can imagine
backends that can't deal with this without encoding hacks.

> 2) The unnamed <default> group is written to the ini file without a group
> marker at all. The other toplevel groups are siblings not children of the
> unnamed <default> group, so there is no *root* group.
> 
i know. ;-)
while this doesn't really fit the flat structure of an ini file, the file
itself can/should be viewed as the root group.

> So do we want to support "[]"?
>
no

> If yes, then what should be returned as the name of the <default>
> group? QByteArray()?
>
yes

> > this looks bogus. it should be possible to have an empty group with
> > an immutability marker. fix the entry map if it doesn't work.
> 
> the <default> group is immutable if the file is immutable, since it
> doesn't have it's own group marker in the file,
> 
oh, right ... hmm ... do you think it would make sense (i.e., produce
simpler code overall) to synthetize a root group marker? taking this
further, i think we should consider an actual tree structure for the
entry map. this is all 4.1+ material, of course.

-- 
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