Use XDG_DATA_HOME for storing data instead of HOME.
ClosedPublic

Authored by knauss on Mar 21 2016, 3:21 PM.

Details

Diff Detail

Repository
R44 KDE PIM Runtime
Lint
No Linters Available
Unit
No Unit Test Coverage
knauss updated this revision to Diff 2883.Mar 21 2016, 3:21 PM
knauss retitled this revision from to Use XDG_DATA_HOME for storing data instead of HOME..
knauss updated this object.
knauss added reviewers: mlaurent, dvratil.
Restricted Application added a project: KDE PIM. · View Herald TranscriptMar 21 2016, 3:21 PM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript
krop added a subscriber: krop.Mar 21 2016, 9:10 PM

XDG_*_HOME are not mandatory. If XDG_DATA_HOME is not set, the users will get errors when starting Akonadi for the first time.

In D1192#22692, @cgiboudeaux wrote:

XDG_*_HOME are not mandatory. If XDG_DATA_HOME is not set, the users will get errors when starting Akonadi for the first time.

well at least the freedesktop documentation says, that if XDG_DATA_HOME is not available it should be replaced with $HOME/.local/share.
I search a little bit around and found, that KConfig is using qgetenv to replace a environemt variable to its content - What is a simple call of getenv, so at least I see that we really won't replace XDG_DATA_HOME with any usefull if, the env variable is not set.

ach added a subscriber: ach.Mar 24 2016, 10:54 PM

As qgetenv/getenv does not handle shell features like ${XDG_DATA_HOME:=~/.local/share} another solution may be:

if the Path config var is a relative path prepend ${XDG_DATA_HOME:=~/.local/share}
This would need some logic when reading and writing the Path variable.
(Maybe there exists an XDG_* helper class for QT as it exists for python?)

Achim

Well the support is now entering kconfig https://git.reviewboard.kde.org/r/127462/

With that in place we can easily use $QT_DATA_HOME

mlaurent edited edge metadata.Mar 28 2016, 6:56 PM

So we need to add dependancy against new kf5 (when released)

mlaurent accepted this revision.May 20 2016, 5:05 AM
mlaurent edited edge metadata.

Now we depend against 5.22 you can commit it I think.

This revision is now accepted and ready to land.May 20 2016, 5:05 AM
This revision was automatically updated to reflect the committed changes.