GNOME Bugzilla – Bug 524304
Use XDG_USER_DATA to store the recent files
Last modified: 2010-10-22 11:25:43 UTC
instead of using a dotfile in $HOME, use $XDG_USER_DATA/recently-used.xbel
the patch is part of the changeset attached to bug 528035
*** Bug 568526 has been marked as a duplicate of this bug. ***
Created attachment 145722 [details] [review] Use XDG_USER_DATA to store the recent files For the record, I've attached here the Emmanuele patch Can this be applied?
+1, hope to see this change
That patch needs a check whether the "old" location was used before and copy over it the first time. ie. no "new file existant, but "old" file is there --> copy over the file, maybe delete the old file
Created attachment 160234 [details] [review] Use XDG_USER_DATA to store the recent files.v2 Updated patch against current master. As this will land for GTK+3, maybe the compatibility code is not needed anymore. Thoughts?
Hmm. The code uses g_bookmark_file_to_file to save the file, which just uses g_file_set_contents() and thus will fail if the directory doesn't exist. (This isn't a problem right now since $HOME will very likely exist.) So the directory needs to be created with g_mkdir_with_parents(dir, 0700) before doing g_bookmark_file_to_file().
also, it would not follow symbolic links. I think we should be using g_bookmark_file_to_data() and then GIO.
would it better be placed in $XDG_CACHE_HOME?
this patch not works very well... still have ~/.recently-used.xbel
(In reply to comment #9) > would it better be placed in $XDG_CACHE_HOME? no, it's not a per-application cache file: it's shared among applications.
Since we're breaking API, I just moved the default file from $HOME to $XDG_USER_DATA.
Re comment 11: I don't see how XDG_CACHE_HOME is only for per-app caches? Surely global caches are appropriate for it too. The spec definition [1] of XDG_CACHE_HOME as "non-essential" user data certainly fits the recently-used file perfectly. [1] http://standards.freedesktop.org/basedir-spec/latest/ar01s02.html: * There is a single base directory relative to which user-specific non-essential (cached) data should be written. This directory is defined by the environment variable $XDG_CACHE_HOME.