GNOME Bugzilla – Bug 494007
Empathy should conform to the XDG directory specification
Last modified: 2009-08-02 03:15:12 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:
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?
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...)
Avatar cache is now in XDG_CACHE_HOME. The rest still need to be moved.
Created attachment 136783 [details] [review] Put configuration data in XDG_CONFIG_DIRS (GNOME bug 494007)
Do note in 2007 I am sure some migration code wouldn't have been necessary; but perhaps it is now.
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.
Note that we'll need migration code for accounts and logs (maybe avatar cache too) when we'll move to MC5.
Created attachment 136865 [details] [review] migrate configuration files to XDG config directory
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
(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
Created attachment 138831 [details] [review] migrate configuration files to XDG config directory
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)).
Ok, please commit :)
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)
This patch introduced a trailing tab at empathy.c line 701