Special characters in KConfig

kde.braxton at gmail.com kde.braxton at gmail.com
Wed Feb 6 15:20:13 GMT 2008


On 2/6/08, Lubos Lunak <l.lunak at suse.cz> wrote:
> On Wednesday 06 of February 2008, kde.braxton at gmail.com wrote:
> > On 2/6/08, Lubos Lunak <l.lunak at suse.cz> wrote:
> > >  Hello,
> > >
> > >  I've just spent 2+ hours trying to write a trivial kconf_update script.
> > > Unsuccessfully. Because of the @%^!^@!^!! idea to use 1 (not '1', but
> > > numeric
> > > 1) as separator in KGlobalAccel items, used as keys for KConfig. And,
> > > after that, I noticed KConfig itself does something similar
> > > intentionally, with http://websvn.kde.org/?view=rev&revision=740551
> > > replacing the rather obvious and intuitive '/' with '\x01d' as the group
> > > separator (in nested groups).
> > >
> > >  Now, the questions I have, are:
> > > - how the hell is one supposed to handle either of those with
> > > kconf_update - dtto, with kreadconfig/kwriteconfig
> > > - will somebody have a problem with me making KConfig simply assert on
> > > any non-printable character in key or group name, and use '/' again for
> > > groups?
> >
> > the group separator was changed because using '/' broke icon-themes
> > and other configs that have groups that use '/' in the name. the char
> > '\x1d' was chosen for exactly the reason that it should be almost
> > never used in a normal group name. see
> > http://lists.kde.org/?l=kde-core-devel&m=119567100708496&w=2 for the
> > discussion.
>
>  I see. That still doesn't answer any of the other questions though. The
> three
> mentioned tools still need to work with it and they should just use plain
> text. Making them use control characters is just as bad as making them
> depend
> on KConfig internals, and can't think of any other way how to express the
> nesting - something like 'kwriteconfig --group parent --group child' is ugly
> and I don't think it'd work with KCmdLineArgs anyway,

I think changing kreadconfig/kwriteconfig to handle nested groups with
'/' and splitting the group names before they are passed to KConfig is
probably the only way they can be made to work. This would probably
preclude having a group that should include '/' in it's name.
something like the attached patch.

> and similarly
> kconf_update is not very extensible on account of being an awful mess.
>
I haven't looked at kconf_update so I ATM have no idea what should be
done there.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kreadconfig-possible-fix.diff
Type: text/x-diff
Size: 1753 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080206/9a1bdf6e/attachment.diff>


More information about the kde-core-devel mailing list