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 518594 - Get rid of .anjuta and follow fd.o specifications
Get rid of .anjuta and follow fd.o specifications
Status: RESOLVED FIXED
Product: anjuta
Classification: Applications
Component: core application
2.2.0
Other Linux
: Normal normal
: ---
Assigned To: Naba Kumar
Anjuta maintainers
Depends on:
Blocks: 523057
 
 
Reported: 2008-02-25 11:56 UTC by Lionel Dricot
Modified: 2008-07-06 15:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to make Anjuta XDG BaseDir Compliant (23.27 KB, patch)
2008-05-29 05:36 UTC, Arun Chaganty
needs-work Details | Review
Fixes a recent change to Anjuta to use the new functions (701 bytes, patch)
2008-06-22 11:47 UTC, Arun Chaganty
needs-work Details | Review
Combined patch using GIO (24.81 KB, patch)
2008-07-05 18:02 UTC, Arun Chaganty
none Details | Review
Updated patch removed unused macro in symbol-db (24.73 KB, patch)
2008-07-05 18:50 UTC, Arun Chaganty
rejected Details | Review
Corrected patch (25.23 KB, patch)
2008-07-06 15:10 UTC, Arun Chaganty
committed Details | Review

Description Lionel Dricot 2008-02-25 11:56:47 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
Comment 1 Johannes Schmid 2008-03-03 10:13:53 UTC
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.
Comment 2 Massimo Cora' 2008-03-03 18:14:12 UTC
(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.

Comment 3 Naba Kumar 2008-03-03 20:11:49 UTC
Make the 'cache' directory is not cleaned up helpfully from somewhere else.
Comment 4 Lionel Dricot 2008-03-27 19:41:28 UTC
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
Comment 5 Arun Chaganty 2008-05-29 05:36:31 UTC
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.
Comment 6 Arun Chaganty 2008-06-22 11:47:13 UTC
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).
Comment 7 Ignacio Casal Quinteiro (nacho) 2008-06-24 13:17:56 UTC
Maybe you could use gio instead of g_mkdir_with_parents now that anjuta supports gio.
Comment 8 Johannes Schmid 2008-06-28 19:22:58 UTC
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

Comment 9 Arun Chaganty 2008-07-05 18:02:58 UTC
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).
Comment 10 Arun Chaganty 2008-07-05 18:50:06 UTC
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.
Comment 11 Johannes Schmid 2008-07-05 21:37:26 UTC
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...
Comment 12 Arun Chaganty 2008-07-06 15:10:21 UTC
Created attachment 114066 [details] [review]
Corrected patch

Fixed. Terribly sorry about the malformed patch, and the delay
Comment 13 Johannes Schmid 2008-07-06 15:28:15 UTC
Thanks! Please always check about compiler warnings - I fixed some.