From 2cfd8639d02875325e046e2ffeea33d1e2af7067 Mon Sep 17 00:00:00 2001 From: infirit Date: Thu, 16 Jan 2014 00:34:56 +0100 Subject: [PATCH 1/3] plumadirs: Cleanup config dir usage Remove backwards compatibility for < glib 2.6 as we require glib 2.22 at a minimum now. Use g_get_user_config_dir instead of custom logic. Use pluma_dirs_get_user_config_dir in pluma_dirs_get_user_accels_file. --- pluma/pluma-dirs.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/pluma/pluma-dirs.c b/pluma/pluma-dirs.c index 7c7c05d..f2eba2c 100644 --- a/pluma/pluma-dirs.c +++ b/pluma/pluma-dirs.c @@ -37,7 +37,6 @@ gchar* pluma_dirs_get_user_config_dir(void) #ifndef G_OS_WIN32 const gchar* envvar; - const gchar* home; /* Support old libmate env var */ envvar = g_getenv("MATE22_USER_DIR"); @@ -48,19 +47,10 @@ gchar* pluma_dirs_get_user_config_dir(void) } else { - home = g_get_home_dir(); - - if (home != NULL) - { - config_dir = g_build_filename(home, ".config", "pluma", NULL); - } + config_dir = g_build_filename(g_get_user_config_dir(), "pluma", NULL); } #else - #if GLIB_CHECK_VERSION(2, 6, 0) - config_dir = g_build_filename(g_get_user_config_dir(), "pluma", NULL); - #else // glib version < 2.6.0 - config_dir = g_build_filename(g_get_home_dir(), ".config", "pluma", NULL); - #endif + config_dir = g_build_filename(g_get_user_config_dir(), "pluma", NULL); #endif return config_dir; @@ -94,7 +84,7 @@ gchar* pluma_dirs_get_user_accels_file(void) #ifndef G_OS_WIN32 const gchar* envvar; - const gchar* home; + const gchar* config_dir; /* on linux accels are stored in .config/accels * for historic reasons (backward compat with the @@ -109,11 +99,11 @@ gchar* pluma_dirs_get_user_accels_file(void) } else { - home = g_get_home_dir(); + config_dir = pluma_dirs_get_user_config_dir(); - if (home != NULL) + if (config_dir != NULL) { - accels = g_build_filename(home, ".config", "accels", "pluma", NULL); + accels = g_build_filename(config_dir, "accels", "pluma", NULL); } } #else From bacead286679a7baaab6249c7fa99ff07318f449 Mon Sep 17 00:00:00 2001 From: infirit Date: Thu, 16 Jan 2014 00:39:36 +0100 Subject: [PATCH 2/3] pluma-dirs: Fix accel file location --- pluma/pluma-dirs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pluma/pluma-dirs.c b/pluma/pluma-dirs.c index f2eba2c..bb380a2 100644 --- a/pluma/pluma-dirs.c +++ b/pluma/pluma-dirs.c @@ -103,7 +103,7 @@ gchar* pluma_dirs_get_user_accels_file(void) if (config_dir != NULL) { - accels = g_build_filename(config_dir, "accels", "pluma", NULL); + accels = g_build_filename(config_dir, "accels", NULL); } } #else From 86369deb93ae28e39ef59d462fb6693747cb332f Mon Sep 17 00:00:00 2001 From: infirit Date: Wed, 15 Jan 2014 23:32:45 +0100 Subject: [PATCH 3/3] Move user plugins dir to data_dir Plugins don't belong in config_dir so we move them to data_dir. User will need to move the plugin dir to the new location, see NEWS. --- NEWS | 10 +++++++++- pluma/pluma-dirs.c | 8 ++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index b592c54..1a2cec2 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,11 @@ +pluma 1.7.1 +=========== + + * Move user plugin dir from config_dir to data_dir. Plugins should have + never been installed in the config dir as they are not part of the + configuration. This means user will need to move the plugins directory + from: $HOME/.config/pluma/ to $HOME/.local/share/pluma/. + pluma 1.5.0 =========== @@ -5,4 +13,4 @@ pluma 1.5.0 (All code is migrated, except pythonconsole plugin. The plugin works, except you cant configure it; the configurable things were command and error colors; this will be fixed migrating the plugin to Gir - instead of python-gtk) \ No newline at end of file + instead of python-gtk) diff --git a/pluma/pluma-dirs.c b/pluma/pluma-dirs.c index bb380a2..fdeaa62 100644 --- a/pluma/pluma-dirs.c +++ b/pluma/pluma-dirs.c @@ -67,13 +67,13 @@ gchar* pluma_dirs_get_user_cache_dir(void) gchar* pluma_dirs_get_user_plugins_dir(void) { - gchar* config_dir; + gchar* data_dir; gchar* plugin_dir; - config_dir = pluma_dirs_get_user_config_dir(); + data_dir = g_get_user_data_dir(); - plugin_dir = g_build_filename(config_dir, "plugins", NULL); - g_free(config_dir); + plugin_dir = g_build_filename(data_dir, "pluma", "plugins", NULL); + g_free(data_dir); return plugin_dir; }