KConfig and $HOME

Oswald Buddenhagen ossi at kde.org
Wed Oct 17 11:10:00 BST 2007


On Wed, Oct 17, 2007 at 04:33:06AM -0500, Thomas Braxton wrote:
> I also changed readEntry<QString>/readEntry<QStringList> to behave
> like KDE3 and expand env vars if [$e] was specified.
> 
why only the QString variants? *all* readEntry variants should
understand [$e] - and this is also the kde3 behavior (except for the
*Untranslated variants, but this is most probably not intentional).

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.

i think the proper solution is expanding first and introducing an
additional escape to separator-quote the expanded string:

$ 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")

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