After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 522806 - Eye of GNOME doesn't match FreeDesktop directories specs
Eye of GNOME doesn't match FreeDesktop directories specs
Status: RESOLVED FIXED
Product: eog
Classification: Core
Component: general
2.22.x
Other All
: Normal normal
: GNOME3.0
Assigned To: EOG Maintainers
EOG Maintainers
: 613641 (view as bug list)
Depends on:
Blocks: 523057
 
 
Reported: 2008-03-16 18:47 UTC by antistress
Modified: 2010-10-31 22:55 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
moving-confiuration-to-xdg-folders (1.82 KB, patch)
2010-08-21 10:56 UTC, Sebastian
reviewed Details | Review
add-combat-code-for-moving-config-and-cache-files (2.37 KB, patch)
2010-08-21 10:56 UTC, Sebastian
needs-work Details | Review
combat code and fixes for previous patch (3.82 KB, patch)
2010-08-28 18:13 UTC, Sebastian
none Details | Review

Description antistress 2008-03-16 18:47:38 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:
Comment 1 Lionel Dricot 2008-03-27 19:43:17 UTC
Also see the proposed Gnome Goal : http://live.gnome.org/GnomeGoals/XDGConfigFolders
Comment 2 Lucas Rocha 2008-03-29 21:56:14 UTC
Hi Lionel, I'd like to first have this GNOME Goal "approved" by community before fixing this bug. Have you properly announced it? 
Comment 3 Lionel Dricot 2009-07-17 19:22:45 UTC
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.
Comment 4 Felix Riemann 2010-03-28 18:07:56 UTC
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.
Comment 5 Felix Riemann 2010-03-28 18:11:42 UTC
*** Bug 613641 has been marked as a duplicate of this bug. ***
Comment 6 Sebastian 2010-08-21 10:56:21 UTC
Created attachment 168449 [details] [review]
moving-confiuration-to-xdg-folders
Comment 7 Sebastian 2010-08-21 10:56:51 UTC
Created attachment 168450 [details] [review]
add-combat-code-for-moving-config-and-cache-files
Comment 8 Sebastian 2010-08-21 10:57:27 UTC
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
Comment 9 Felix Riemann 2010-08-22 09:22:39 UTC
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.
Comment 10 Felix Riemann 2010-08-28 12:15:45 UTC
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.
Comment 11 Felix Riemann 2010-08-28 12:20:21 UTC
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.
Comment 12 Sebastian 2010-08-28 18:13:32 UTC
Created attachment 168959 [details] [review]
combat code and fixes for previous patch
Comment 13 Sebastian 2010-08-28 18:14:49 UTC
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
Comment 14 Felix Riemann 2010-10-31 18:20:48 UTC
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.
Comment 15 Christian Persch 2010-10-31 19:50:13 UTC
+ 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).
Comment 16 Felix Riemann 2010-10-31 22:55:10 UTC
(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.