[PATCH] KConfig code cleanups

Thomas Braxton kde.braxton at gmail.com
Mon Oct 29 02:44:40 GMT 2007


On 10/28/07, Oswald Buddenhagen <ossi at kde.org> wrote:
>
> 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


good, it just looked wierd to me :)

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


not a problem, but, since we're not supporting "[]", what would be the
problem with using "" as the name of the default group? I was thinking that
we could use this to verify that we have a valid key by testing
mGroup.isNull() ==> invalid key, something wierd happened.

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


not really, just pointing it out. but since you say we should consider the
file itself as the default group then we don't need to put a group marker
for the default group, because the immutable flag for the file could be
looked at as the immutable flag for the default group. And since there's no
way ATM to set the immutable flag for a group or entry, we don't have to
worry about writing it out.

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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071028/9490950b/attachment.htm>


More information about the kde-core-devel mailing list