[patch] XDG dirs on Windows - Akonadi data/config as an example
Christian Ehrlicher
Ch.Ehrlicher at gmx.de
Wed Aug 13 09:38:48 CEST 2008
Jaroslaw Staniek schrieb:
> hi
> This is not quite topic for kde-windows; it rather belongs to lower level.
> But we tend to rather carefully select our dirs, so:
>
> The base dir defined by XDG specs is $HOME, and subdirs are hidden, e.g.
> .config, .local.
> On Windows we have $APPDATA and $HOME, and I would say the former is
> preferred
> to flood with subdirs.
> While trying to make Akonadi run on Windows flawlessy (it required mysql
> server instance) and looking at current
> kdesupport/akonadi/libs/xdgbasedirs.cpp, in particular
> XdgBaseDirs::homePath()
> method, I can see that the config dirs are computed as follows:
>
> 1. if $XDG_CONFIG_HOME exists, it's used; $HOME is prepended if
> $XDG_CONFIG_HOME is not absolute.
> 2. if $XDG_CONFIG_HOME is empty; $HOME is selected as the base dir.
> 3. to the result of 1. or 2., subdir name is added, e.g. .config or .local.
>
> Now on Windows it means you'd end up with cryptic .config and .local
> files not
> really related to the operating system specs, when hidden files are not
> denoted by the leading dot.
>
> My proposal is to use $APPDATA/XDG/ or if $APPDATA is empty, $HOME/XDG/ as
> default (i.e. when expected $XDG_* variable is empty).
>
> That would clearly give one root directory for any XDG-compliant
> settings on
> the OS where XDG is uncommon.
>
> Appropriate patch is attached.
>
Please do not use env vars but ShGetSpecialFolderPathW like we did for
kde4 and marble config files.
Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
Url : http://mail.kde.org/pipermail/kde-windows/attachments/20080813/8d90ab1e/attachment-0001.pgp
More information about the Kde-windows
mailing list