Special characters in KConfig

Lubos Lunak l.lunak at suse.cz
Wed Feb 6 14:16:46 GMT 2008


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, and similarly 
kconf_update is not very extensible on account of being an awful mess.

 Any ideas?

-- 
Lubos Lunak
KDE developer
--------------------------------------------------------------
SUSE LINUX, s.r.o.   e-mail: l.lunak at suse.cz , l.lunak at kde.org
Lihovarska 1060/12   tel: +420 284 028 972
190 00 Prague 9      fax: +420 284 028 951
Czech Republic       http//www.suse.cz




More information about the kde-core-devel mailing list