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 494007 - Empathy should conform to the XDG directory specification
Empathy should conform to the XDG directory specification
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: General
0.21.x
Other All
: Normal minor
: ---
Assigned To: empathy-maint
empathy-maint
Depends on:
Blocks: 523057
 
 
Reported: 2007-11-06 03:43 UTC by Laurent Bigonville
Modified: 2009-08-02 03:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Put configuration data in XDG_CONFIG_DIRS (GNOME bug 494007) (5.29 KB, patch)
2009-06-16 21:50 UTC, Frederic Peters
committed Details | Review
migrate configuration files to XDG config directory (2.42 KB, patch)
2009-06-17 19:49 UTC, Frederic Peters
none Details | Review
migrate configuration files to XDG config directory (2.52 KB, patch)
2009-07-20 17:16 UTC, Frederic Peters
committed Details | Review

Description Laurent Bigonville 2007-11-06 03:43:30 UTC
Please describe the problem:
Empathy should conform to the XDG directory specification

For storing logs and other stuff like that

See: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

Steps to reproduce:
1. 
2. 
3. 


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Xavier Claessens 2007-11-29 14:15:49 UTC
I use XDG dirs for everything but not for storing user data. Empathy is a GNOME program so I use ~/.gnome2 like all other GNOME programs... I'm not against changing to ~/.local/ but I would like to see a GNOME decision on this before.

Is there a conversation on gnome devel list about that topic?
Comment 2 Simon McVittie 2007-12-17 12:12:28 UTC
There are multiple parts of the basedir spec: config in $XDG_CONFIG_HOME:$XDG_CONFIG_DIRS (~/.config etc. by default), user data in $XDG_DATA_HOME:$XDG_DATA_DIRS (~/.local/share etc. by default), and disposable/cached data in $XDG_CACHE_HOME (~/.cache by default).

The cache part would be particularly useful to implement, since it then becomes easy to exclude caches from backups. (I've just done a backup which ended up much larger than it should have been, so I'm going to go round filing bugs on everything with its own cache directory...)
Comment 3 Xavier Claessens 2008-06-02 20:54:22 UTC
Avatar cache is now in XDG_CACHE_HOME. The rest still need to be moved.
Comment 4 Frederic Peters 2009-06-16 21:50:25 UTC
Created attachment 136783 [details] [review]
Put configuration data in XDG_CONFIG_DIRS (GNOME bug 494007)
Comment 5 Frederic Peters 2009-06-16 21:52:00 UTC
Do note in 2007 I am sure some migration code wouldn't have been necessary; but perhaps it is now.
Comment 6 Xavier Claessens 2009-06-17 07:07:28 UTC
The patch is good, but indeed we need a migration code. At startup, you have to check if there is something in .gnome2/Empathy and nothing in .config/Empathy (except logs) and move everything if needed.
Comment 7 Xavier Claessens 2009-06-17 07:08:50 UTC
Note that we'll need migration code for accounts and logs (maybe avatar cache too) when we'll move to MC5.
Comment 8 Frederic Peters 2009-06-17 19:49:05 UTC
Created attachment 136865 [details] [review]
migrate configuration files to XDG config directory
Comment 9 Xavier Claessens 2009-06-18 10:10:12 UTC
comments:

1) if old_dir does not exist, you leak xdg_dir
2) I think you should replace g_warning by DEBUG(). File operations can fail for various reasons, warnings are for programmation bugs that should *never* happen if the program is correct.
3) If creation of the xdg_dir fails, we can we hope? I think we should return
4) for (i=0; filenames[i]; i++) { --> i = 0
5) +	static char* filenames[] = { --> static const gchar* I think, no?
6) Is there an async version of g_file_move()? I can't find it, but that looks suspicious...
7) s/g_message/DEBUG/
8) If some operation fail, the user is in very bad situation... I think a gtk_message_dialog should report any error to tell the user his configs are lost :p
Comment 10 Luca Ferretti 2009-07-03 06:03:09 UTC
(In reply to comment #1)
> I use XDG dirs for everything but not for storing user data. Empathy is a GNOME
> program so I use ~/.gnome2 like all other GNOME programs... I'm not against
> changing to ~/.local/ but I would like to see a GNOME decision on this before.
> 
> Is there a conversation on gnome devel list about that topic?
> 

See this (yet non official) GNOME Goal: http://live.gnome.org/GnomeGoals/XDGConfigFolders

I just wrote an email to desktop-devel-list asking if we should/coudl make official for 3.0
Comment 11 Frederic Peters 2009-07-20 17:16:08 UTC
Created attachment 138831 [details] [review]
migrate configuration files to XDG config directory
Comment 12 Frederic Peters 2009-07-20 17:18:19 UTC
This updated patch addresses all issues but the last one, I think it would be adding much UI code for a situation that will ~never arise (this is all about moving files on the same filesystem (this is also why there is no need for an async version of g_file_move here)).
Comment 13 Xavier Claessens 2009-07-21 15:35:09 UTC
Ok, please commit :)
Comment 14 Frederic Peters 2009-07-21 15:41:56 UTC
Thanks, pushed.

commit 6fa59ef0e20828af6404821b198468ae3a9ef158
Author: Frédéric Péters <fpeters@0d.be>
Date:   Mon Jul 20 19:13:37 2009 +0200

    migrate configuration files to XDG config directory

commit e1fa17399fc137a508f195aa6976b5f32189de96
Author: Frédéric Péters <fpeters@0d.be>
Date:   Wed Jun 17 10:01:52 2009 +0200

    Put configuration data in XDG_CONFIG_DIRS (GNOME bug 494007)
Comment 15 Nicolò Chieffo 2009-07-22 15:04:01 UTC
This patch introduced a trailing tab at empathy.c line 701