diff options
author | Perberos <[email protected]> | 2012-01-30 12:06:56 -0300 |
---|---|---|
committer | Perberos <[email protected]> | 2012-01-30 12:06:56 -0300 |
commit | 934a0a1f1c7766dd8193e020af6bed8134488e83 (patch) | |
tree | 2630dd2462014ed2a3b357dc09dcf1072bb7fe16 /stickynotes/stickynotes.c | |
parent | 022106354aff7cabceed8a5fe48d7a0b6a303115 (diff) | |
download | mate-applets-934a0a1f1c7766dd8193e020af6bed8134488e83.tar.bz2 mate-applets-934a0a1f1c7766dd8193e020af6bed8134488e83.tar.xz |
g_get_user_config_dir() would be better (https://github.com/mate-desktop/mate-panel/issues/8)
Diffstat (limited to 'stickynotes/stickynotes.c')
-rw-r--r-- | stickynotes/stickynotes.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/stickynotes/stickynotes.c b/stickynotes/stickynotes.c index fc273943..11448623 100644 --- a/stickynotes/stickynotes.c +++ b/stickynotes/stickynotes.c @@ -839,12 +839,16 @@ stickynotes_save_now (void) g_free(body); } - /* The XML file is $HOME/.config/mate/stickynotes_applet, most probably */ + /* The XML file is $HOME/.config/mate/stickynotes-applet, most probably */ { - gchar* file = g_build_filename(g_get_home_dir(), ".config", "mate", "stickynotes-applet.xml", NULL); + #if GLIB_CHECK_VERSION(2, 6, 0) + gchar* file = g_build_filename(g_get_user_config_dir(), "mate", "stickynotes-applet.xml", NULL); + #else // glib version < 2.6.0 + gchar* file = g_build_filename(g_get_home_dir(), ".config", "mate", "stickynotes-applet.xml", NULL); + #endif xmlSaveFormatFile(file, doc, 1); - + g_free(file); } @@ -876,10 +880,14 @@ stickynotes_load (GdkScreen *screen) GList *new_notes, *tmp1; /* Lists of StickyNote*'s */ GList *new_nodes; /* Lists of xmlNodePtr's */ int x, y, w, h; - /* The XML file is $HOME/.config/mate/stickynotes_applet, most probably */ + /* The XML file is $HOME/.config/mate/stickynotes-applet, most probably */ { /* retro-compatibilidad con ~/.mate2/ */ - gchar* file = g_build_filename(g_get_home_dir(), ".config", "mate", "stickynotes-applet.xml", NULL); + #if GLIB_CHECK_VERSION(2, 6, 0) + gchar* file = g_build_filename(g_get_user_config_dir(), "mate", "stickynotes-applet.xml", NULL); + #else // glib version < 2.6.0 + gchar* file = g_build_filename(g_get_home_dir(), ".config", "mate", "stickynotes-applet.xml", NULL); + #endif if (g_file_test(file, G_FILE_TEST_EXISTS)) { @@ -890,7 +898,7 @@ stickynotes_load (GdkScreen *screen) { /* old one */ g_free(file); - + file = g_build_filename(g_get_home_dir(), ".mate2", "stickynotes_applet", NULL); if (g_file_test(file, G_FILE_TEST_EXISTS)) @@ -899,7 +907,7 @@ stickynotes_load (GdkScreen *screen) doc = xmlParseFile(file); } } - + g_free(file); } |