[patch] XDG dirs on Windows - Akonadi data/config as an example

Jaroslaw Staniek js at iidea.pl
Wed Aug 13 09:19:04 CEST 2008


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.

-- 
regards / pozdrawiam, Jaroslaw Staniek
   Sponsored by OpenOffice Polska (http://www.openoffice.com.pl/en) to work on
   Kexi & KOffice (http://www.kexi.pl/en, http://www.koffice.org/kexi)
   KDE Libraries for MS Windows (http://windows.kde.org)

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: paths.patch
Url: http://mail.kde.org/pipermail/kde-windows/attachments/20080813/08dce914/attachment.ksh 


More information about the Kde-windows mailing list