Merge pull request #55 from infirit/pluma-dirs

Move plugins to data_dir, fix accel file location and minor cleanup
This commit is contained in:
Stefano Karapetsas 2014-01-17 03:20:49 -08:00
commit 587c11cec2
2 changed files with 19 additions and 21 deletions

8
NEWS
View File

@ -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
===========

View File

@ -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;
@ -77,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;
}
@ -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", NULL);
}
}
#else