KConfig and $HOME
Oswald Buddenhagen
ossi at kde.org
Wed Oct 17 14:18:14 BST 2007
On Wed, Oct 17, 2007 at 07:58:30AM -0500, Thomas Braxton wrote:
> On 10/17/07, Oswald Buddenhagen <ossi at kde.org> wrote:
> > why only the QString variants? *all* readEntry variants should
> > understand [$e]
>
> why would you want to expand an int or a color? expanding strings and
> paths is the only thing that makes sense,
>
an impressive lack of imagination, this is. not that i'm surprised after
the backslash quoting discussion before ... :-/
> but it can be added if really necessary.
>
it is.
> > there is some confusion with [$e] vs. list handling.
> > - kde3 expands before splitting. this may lead to spurious splits.
> > - your code expands after splitting. this makes scripting lists
> > impossible. also, shell statements containing the separator char will
> > be torn apart, which is highly unexpected.
>
> actually only readPathList expands second,
>
oh, well. :)
> but this can be changed to match readEntry<QStringList>, patch
> attached
>
it won't make things worse, at least.
> > i think the proper solution is expanding first and introducing an
> > additional escape to separator-quote the expanded string:
>
> not even sure what that's supposed to mean?
>
how about trying to understand the examples given in the context of what
we are talking about?
> > $ export VAR="foo;bar"
> > $ cat foorc
> > # note that this contains additional low-level quoting
> > # "foo" "bar"
> > ListKey1[$e]=$VAR
> > # "foo" "bar"
> > ListKey2[$e]=$(echo "foo;bar")
> > # "foo;bar"
> > ListKey3[$e]=$\\VAR
> > # "foo;bar"
> > ListKey4[$e]=$\\(echo "foo;bar")
the process is read ini => parse ini => expand => parse lists. to
prevent the last step from chopping up the result, the separators (and
the escape char itself) need to be escaped - that's what the weirdly
placed backslash means (btw, the syntax is odd, but i have no better
idea).
fwiw, puthuhn seems to have just finished the refactoring we are still
pondering. let's see what he sends me. :-)
--
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