GNOME Bugzilla – Bug 522806
Eye of GNOME doesn't match FreeDesktop directories specs
Last modified: 2010-10-31 22:55:10 UTC
Please describe the problem: I found that EoG 2.22 (Ubuntu Hardy alpha 6) places its files in .gnome2/eog/ which doesn't match FreeDesktop directories specs : The default for $XDG_CONFIG_HOME is $HOME/.config, the default for $XDG_DATA_HOME is $HOME/.local/share. So all applications should look for those environment variables and use those default values if the variables are not set. See http://www.freedesktop.org/wiki/Specifications/basedir-spec See also - http://ploum.frimouvy.org/?184-cleaning-user-preferences-keeping-user-data (main post and comment#8) - http://www.aigarius.com/blog/2007/01/10/fhs-extension-for-user-home-folders/ Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? Other information:
Also see the proposed Gnome Goal : http://live.gnome.org/GnomeGoals/XDGConfigFolders
Hi Lionel, I'd like to first have this GNOME Goal "approved" by community before fixing this bug. Have you properly announced it?
Hello Luca, I've tried to announce it a year ago on different mailing list. Nobody ever replied more than "good idea" except Vuntz which want to see some debate about it. Unfortunatly, there doesn't seem to be any debate on the desktop scale. Fortunatly, it seems that most maintener agree with the idea and, at least, accept the bug as valid.
I am going to look into this during the next unstable period. It looks like the migration code used in empathy can be reused here. eog doesn't have much data in these folders, so it's not a great loss if still something goes wrong.
*** Bug 613641 has been marked as a duplicate of this bug. ***
Created attachment 168449 [details] [review] moving-confiuration-to-xdg-folders
Created attachment 168450 [details] [review] add-combat-code-for-moving-config-and-cache-files
I have created a patch for eog which puts the files into the XDG folders and also contains some combat code to move the files into the new folders: id 168449 id 168450 cheers
From a quick look: I'd say the accels file should be in .config as well. It's not something we do for performance reasons (as .cache implies). Will take a deeper look later.
Review of attachment 168449 [details] [review]: The patch is pretty much okay. Just a few small nitpicks. :) ::: src/eog-application.c @@ +544,3 @@ eog_application_load_accelerators (void) { + gchar *accelfile = g_build_filename (g_get_user_cache_dir (), I'd put the accelerators file in XDG_USER_CONFIG_DIR/eog (e.g. using 'accels' as filename) @@ +558,3 @@ + if(!g_file_test(path, G_FILE_TEST_IS_DIR)) + g_mkdir(path, 0700); + gchar *accelfile = g_build_filename (path, Please check the indentation. We use TABs (8 chars wide) for indentation. Could be fixed during commiting if necessary.
Review of attachment 168450 [details] [review]: I'd rather see this done using GIO. Also, the presence of the old config should not cause it to generally overwrite a present new config.
Created attachment 168959 [details] [review] combat code and fixes for previous patch
Hi, do you like that better? I'm now checking for each file before i overwrite it. I am also putting accels into XDG_CONFIG_HOME now. Cheers Lanoxx
Thanks, used your patches as a base (please respect the indentation) for a little refactoring to make things a bit simpler and safer. I also made your commit messages a bit more descriptive. commit 931cdd9e3fdc35f94494a40640f3eae694dbfc07 Author: Felix Riemann <> Date: Sun Oct 31 19:08:43 2010 +0100 Refactor XDG folders migration Merges the multiple migration points into a single one. Use GIO for moving files which avoids overwriting present stuff. Remove old config folder once it's empty. Only migrate files that actually belong to eog. Concludes bug 522806. commit c92e86a6e9816ac5a5a1a97ac6786a06aed9cb81 Author: Sebastian Geiger <> Date: Sat Aug 21 12:44:48 2010 +0200 Add code for migrating config and cache file to XDG folders Move files from old config dir into XDG-based config folder. Part of bug 522806. commit ad1bb602f3a922681da5b9d6ae9f9cc75c8dc0ff Author: Sebastian Geiger <> Date: Sat Aug 21 12:11:30 2010 +0200 Place configuration files into an XDG standard config folder Just replaces the paths for now. Part of bug 522806. This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
+ gchar *path = g_build_filename(g_get_user_cache_dir (), "eog"); + if(!g_file_test(path, G_FILE_TEST_IS_DIR)) + g_mkdir(path, 0700); You need g_mkdir_with_parents() here, and everywhere else where you create an xdg folder (can't assume the parent already exists).
(In reply to comment #15) > + gchar *path = g_build_filename(g_get_user_cache_dir (), "eog"); > + if(!g_file_test(path, G_FILE_TEST_IS_DIR)) > + g_mkdir(path, 0700); > > You need g_mkdir_with_parents() here, and everywhere else where you create an > xdg folder (can't assume the parent already exists). Oh, right. Didn't catch that in the patches. The refactoring takes care of this though by reusing the old folder creation code that used g_mkdir_with_parents already.