diff options
author | infirit <[email protected]> | 2014-01-16 00:34:56 +0100 |
---|---|---|
committer | infirit <[email protected]> | 2014-01-16 00:41:55 +0100 |
commit | 2cfd8639d02875325e046e2ffeea33d1e2af7067 (patch) | |
tree | 180edd118e9383a70d4d8bbc329d68ad3b45ef56 | |
parent | 2adb637a2e32c5a7ee7c9cb25fde19e44b176ec2 (diff) | |
download | pluma-2cfd8639d02875325e046e2ffeea33d1e2af7067.tar.bz2 pluma-2cfd8639d02875325e046e2ffeea33d1e2af7067.tar.xz |
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.
-rw-r--r-- | pluma/pluma-dirs.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/pluma/pluma-dirs.c b/pluma/pluma-dirs.c index 7c7c05dd..f2eba2c5 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 |