GNOME Bugzilla – Bug 518594
Get rid of .anjuta and follow fd.o specifications
Last modified: 2008-07-06 15:28:15 UTC
Anjuta shouldn't create a .anjuta folder. According to fd.o specification, it should put user preferences in $XDG_CONFIG_HOME. Any user date should go to $XDG_DATA_HOME. Any cache stuffs should go to $XDG_CACHE_HOME More infos : http://standards.freedesktop.org/basedir-spec/latest/ar01s03.html The reason why I'm reporting this bug : http://ploum.frimouvy.org/?184-cleaning-user-preferences-keeping-user-data
OK, am I correct that we should use g_get_user_cache_dir()/anjuta/ for the last session (open files, layout of the windows, everything not essential) and g_get_user_config_dir for macros, tools and valgrind rules created by the user. I am not yet sure where to store our system tags database. On the one hand it is just generated with the libraries installed on the system, on the other hand it takes some time (> 10 minutes) to generate this. But it looks rather non-essential so putting it in g_get_user_cache_dir()/anjuta should work. @Massimo, do you agree here? Maybe we should add anjuta_utils_get_cache_dir() and anjuta_utils_get_config_dir() in anjuta-utils.h to avoid a lot of g_build_filename calls in the whole source code.
(In reply to comment #1) > OK, am I correct that we should use > > g_get_user_cache_dir()/anjuta/ for the last session (open files, layout of the > windows, everything not essential) > > and > > g_get_user_config_dir for macros, tools and valgrind rules created by the user. > > I am not yet sure where to store our system tags database. On the one hand it > is just generated with the libraries installed on the system, on the other hand > it takes some time (> 10 minutes) to generate this. But it looks rather > non-essential so putting it in g_get_user_cache_dir()/anjuta should work. > > @Massimo, do you agree here? > take into consideration that the cache may also have a big size (5 to 10 MB). If it's ok to have such big files there then there's no problem for me. > Maybe we should add anjuta_utils_get_cache_dir() and > anjuta_utils_get_config_dir() in anjuta-utils.h to avoid a lot of > g_build_filename calls in the whole source code. > this is fine.
Make the 'cache' directory is not cleaned up helpfully from somewhere else.
Johannes : macros, tools and valgrind rules created by the user should go in $XDG_DATA_HOME open files, layout of the windows, everything not essential should go to $XDG_CONFIG_HOME Always remember that : if you remove the $XDG_CACHE_HOME folder, the user will not noticing it except maybe for performances (might be huge performance). If you remove the $XDG_CONFIG_HOME fodler, the user will see all the preferences reset to the default but without any data loss. In fact, it would not be a problem if the user didn't customize his desktop. A contrario, $XDG_DATA_HOME should be treated as any other user file. See : http://live.gnome.org/GnomeGoals/XDGConfigFolders
Created attachment 111704 [details] [review] Patch to make Anjuta XDG BaseDir Compliant This patch should (hopefully) make conform to the standard. I've made a few helper functions, which get files, and directories from the standard locations (note, directories must end with a '/'). After applying the patch, anjuta does not create a .anjuta folder. The patch contains changes to all the current anjuta plugins to make them save stuff only in the XDG specified directories. It also fixes a shell script (create_global_tags) to do the same. It replaces (and extends) an earlier function _get_user_config_dir.
Created attachment 113194 [details] [review] Fixes a recent change to Anjuta to use the new functions The code that was initially in src/anjuta-app.c (get_accel) was moved to libanjuta/anjuta-ui.c. This code uses the older _get_user_config_dir. The patch changes it to use the new _get_user_config_uri function (and brings the function size down to one line).
Maybe you could use gio instead of g_mkdir_with_parents now that anjuta supports gio.
Hi! The patch looks good to me but could you please merge the two patches into one and mind comment #7 from nacho? Did you check that all files are still installed in the correct directories? Regards, Johannes
Created attachment 114027 [details] [review] Combined patch using GIO Sorry for taking so long with it. Notes: * Uses GIO. * Creates 6 (public) functions in total, 3 to get the respective file as a GFile, and the remaining 3 to get just the filenames (useful until everything else is ported to GIO) * Rewrites anjuta_util_create_dir to use GIO as well (and adds a few tests too).
Created attachment 114031 [details] [review] Updated patch removed unused macro in symbol-db The same patch as above, but removing the LOCAL_ANJUTA_GLOBAL_DB_DIRECTORY macro, that is not used anywhere in the plugin.
The patch does not apply - malformed patch at line 402 Please don't try to edit diff files by hand - it doesn't work in 99% of the cases...
Created attachment 114066 [details] [review] Corrected patch Fixed. Terribly sorry about the malformed patch, and the delay
Thanks! Please always check about compiler warnings - I fixed some.