diff options
author | Perberos <[email protected]> | 2012-02-22 01:47:46 -0300 |
---|---|---|
committer | Perberos <[email protected]> | 2012-02-22 01:47:46 -0300 |
commit | c5dfae990e8a774fa3b88454dd5a303cee902573 (patch) | |
tree | 7670beb5de50d48e2687eabef0c5957c1a537c6f | |
parent | 73ff1adc61a874f496a3fbef059f3630aaa182e5 (diff) | |
download | mate-control-center-c5dfae990e8a774fa3b88454dd5a303cee902573.tar.bz2 mate-control-center-c5dfae990e8a774fa3b88454dd5a303cee902573.tar.xz |
g_get_user_config_dir() would be better (https://github.com/mate-desktop/mate-panel/issues/8)
-rw-r--r-- | capplets/appearance/mate-wp-xml.c | 18 | ||||
-rw-r--r-- | capplets/common/mate-theme-info.c | 7 | ||||
-rw-r--r-- | libwindow-settings/mate-wm-manager.c | 7 |
3 files changed, 27 insertions, 5 deletions
diff --git a/capplets/appearance/mate-wp-xml.c b/capplets/appearance/mate-wp-xml.c index c7d7867d..3a0f22a6 100644 --- a/capplets/appearance/mate-wp-xml.c +++ b/capplets/appearance/mate-wp-xml.c @@ -409,7 +409,11 @@ void mate_wp_xml_load_list(AppearanceData* data) char* wpdbfile; gint i; - wpdbfile = g_build_filename(g_get_home_dir(), ".config", "mate", "backgrounds.xml", NULL); + #if GLIB_CHECK_VERSION(2, 6, 0) + wpdbfile = g_build_filename(g_get_user_config_dir(), "mate", "backgrounds.xml", NULL); + #else // glib version < 2.6.0 + wpdbfile = g_build_filename(g_get_home_dir(), ".config", "mate", "backgrounds.xml", NULL); + #endif if (g_file_test(wpdbfile, G_FILE_TEST_EXISTS)) { @@ -419,7 +423,11 @@ void mate_wp_xml_load_list(AppearanceData* data) { g_free (wpdbfile); - wpdbfile = g_build_filename(g_get_home_dir(), ".config", "mate", "wp-list.xml", NULL); + #if GLIB_CHECK_VERSION(2, 6, 0) + wpdbfile = g_build_filename(g_get_user_config_dir(), "mate", "wp-list.xml", NULL); + #else // glib version < 2.6.0 + wpdbfile = g_build_filename(g_get_home_dir(), ".config", "mate", "wp-list.xml", NULL); + #endif if (g_file_test(wpdbfile, G_FILE_TEST_EXISTS)) { @@ -492,7 +500,11 @@ void mate_wp_xml_save_list(AppearanceData* data) g_hash_table_destroy(data->wp_hash); list = g_slist_reverse(list); - wpfile = g_build_filename(g_get_home_dir (), ".config", "mate", "backgrounds.xml", NULL); + #if GLIB_CHECK_VERSION(2, 6, 0) + wpfile = g_build_filename(g_get_user_config_dir(), "mate", "backgrounds.xml", NULL); + #else // glib version < 2.6.0 + wpfile = g_build_filename(g_get_home_dir(), ".config", "mate", "backgrounds.xml", NULL); + #endif xmlKeepBlanksDefault(0); diff --git a/capplets/common/mate-theme-info.c b/capplets/common/mate-theme-info.c index b15abafe..39d721a2 100644 --- a/capplets/common/mate-theme-info.c +++ b/capplets/common/mate-theme-info.c @@ -637,7 +637,12 @@ read_current_cursor_font (void) gchar *dir_name; struct dirent *file_dirent; - dir_name = g_build_filename (g_get_home_dir (), ".config/mate/share/cursor-fonts", NULL); + #if GLIB_CHECK_VERSION(2, 6, 0) + dir_name = g_build_filename(g_get_user_config_dir(), "mate", "share", "cursor-fonts", NULL); + #else // glib version < 2.6.0 + dir_name = g_build_filename(g_get_home_dir(), ".config", "mate", "share", "cursor-fonts", NULL); + #endif + if (! g_file_test (dir_name, G_FILE_TEST_EXISTS)) { g_free (dir_name); return NULL; diff --git a/libwindow-settings/mate-wm-manager.c b/libwindow-settings/mate-wm-manager.c index 3c0d5776..ea17a3cf 100644 --- a/libwindow-settings/mate-wm-manager.c +++ b/libwindow-settings/mate-wm-manager.c @@ -228,7 +228,12 @@ void mate_wm_manager_init(void) scan_wm_directory(tempdir, FALSE); g_free(tempdir); - tempdir = g_build_filename(g_get_home_dir(), ".config", "mate", "wm-properties", NULL); + #if GLIB_CHECK_VERSION(2, 6, 0) + tempdir = g_build_filename(g_get_user_config_dir(), "mate", "wm-properties", NULL); + #else // glib version < 2.6.0 + tempdir = g_build_filename(g_get_home_dir(), ".config", "mate", "wm-properties", NULL); + #endif + scan_wm_directory(tempdir, TRUE); g_free(tempdir); |