Bug 339867 - Some data is stored in $XDG_DATA_HOME (~/.local/share) but $XDG_CACHE_HOME (~/.cache) would be more appropriate
Summary: Some data is stored in $XDG_DATA_HOME (~/.local/share) but $XDG_CACHE_HOME (~...
Status: CONFIRMED
Alias: None
Product: marble
Classification: Applications
Component: general (show other bugs)
Version: 22.12.3
Platform: Kubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: marble-bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-11 08:00 UTC by Laurent Bonnaud
Modified: 2023-04-02 11:09 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Bonnaud 2014-10-11 08:00:35 UTC
Marble uses the ~/.local/share/marble directory to store map tiles.  It should use the ~/.cache/ directory instead.


Reproducible: Always
Comment 1 Dennis Nienhüser 2014-10-12 04:15:40 UTC
Marble follows the XDG Base Directory Specification, see http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

You can set/change the environment variable XDG_DATA_HOME to configure it to use something else (including ~/.cache).
Comment 2 Christoph Feck 2014-10-27 15:30:55 UTC
The difference between the .cache/ and .local/share/ directories is that .cache/ contains data, which can be regenerated by the application, or downloaded from the internet, while .local/share/ contains data, which has been created by the user, and would be included in backups.

Please clarify, if the map files that marble stores there contain modifications made by the user that would be eligible for backups, or if the files are never modified after download.
Comment 3 Christoph Feck 2014-11-16 15:36:36 UTC
Dennis, if you can provide the information requested in comment #2, please add it.
Comment 4 Dennis Nienhüser 2014-11-16 20:38:36 UTC
It does contain user data, e.g. bookmarks, which cannot be recreated by other means. Hence moving it over to ~/.cache is not directly possible.

Is there some sort of standard for ~/.cache? E.g. environment variables that affect its location, or how it is organized. There is a strange lack of anything KDE related in that directory on my system. Instead lots of apps that have counterparts in /opt.
Comment 5 Christoph Feck 2014-11-16 21:00:19 UTC
Yes, there is a standard ($XDG_CACHE_HOME), see the link you provided :)

The basic idea is what I wrote in comment #2.

I remember I deleted tile files, and marble downloaded and/or recreated them when I clicked on a different map again, so my impression was that these could belong to cache, instead of data.

Thanks for the comment. Feel free to close again, if you believe it is impossible to separate the user-editable data (bookmarks etc) from the recreate-able data.
Comment 6 Christoph Feck 2014-11-16 21:06:07 UTC
Btw, the reason you do not see KDE stuff in .cache is because KDE4 used its own cache directory (/var/tmp/kdecache-user), but that is deprecated, as KF5 follows the XDG standards.

See also QStandardPaths, which has both DataLocation, as well as CacheLocation, mapping the two XDG variables mentioned above.
Comment 7 Dennis Nienhüser 2014-11-16 21:09:09 UTC
I'll edit the bug description to be more precise.

Should be possible to implement this in a couple of GCI tasks.
- Extend MarbleDirs to provide both a cache and a data dir
- Change code that uses the data dir but should use the cache dir
- Decide whether data migration is needed for the affected paths (possibly yes) and reactivate/extend our data migration code for it
Comment 8 Laurent Bonnaud 2015-10-02 11:14:05 UTC
The bug is still there in Kubuntu 15.10 and Marble Version 1.11.80 (1.12 Beta 1)
Using:
KDE Frameworks 5.14.0
Qt 5.4.2 (built against 5.4.2)
The xcb windowing system
Comment 9 Adrien 2017-07-08 15:53:01 UTC
Hi,

I would add that the backup systems like backintime usually do backup .local but not .cache by default.

Putting all the cache data in .cache would certainly be more "backup friendly", as the marble folder can be quite heavy (2.7Go on my PC for instance).
Comment 10 Laurent Bonnaud 2021-02-10 11:19:41 UTC
This bug still exists in Ubuntu 20.10 and this package version:

Package: marble
Version: 4:20.08.1-0ubuntu1
Comment 11 Laurent Bonnaud 2021-02-10 11:21:25 UTC
BTW version information is not up to date in the KDE Bugtracking System.  The latest known marble version is 18.04.