diff options
author | Perberos <[email protected]> | 2011-12-21 00:22:32 -0200 |
---|---|---|
committer | Perberos <[email protected]> | 2011-12-21 00:22:32 -0200 |
commit | 932f6f535f3cf5f799ff71c70033ac4d83188d5e (patch) | |
tree | 5c61b2ae4440cbb0231804194eb7648aec050bf1 | |
parent | 0a5d00fa15e087784d4a3498a7de7e110a64c00f (diff) | |
download | mate-applets-932f6f535f3cf5f799ff71c70033ac4d83188d5e.tar.bz2 mate-applets-932f6f535f3cf5f799ff71c70033ac4d83188d5e.tar.xz |
using ~/.config/mate/ instead of ~/.mate2/
-rw-r--r-- | stickynotes/stickynotes.c | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/stickynotes/stickynotes.c b/stickynotes/stickynotes.c index 756fe125..880a1933 100644 --- a/stickynotes/stickynotes.c +++ b/stickynotes/stickynotes.c @@ -840,12 +840,13 @@ stickynotes_save_now (void) } /* The XML file is $HOME/.config/mate/stickynotes_applet, most probably */ - { - gchar *file = g_strdup_printf("%s%s", g_get_home_dir(), - XML_PATH); + //{ + gchar* file = g_build_filename(g_get_home_dir(), ".config", "mate", "stickynotes-applet.xml", NULL); + xmlSaveFormatFile(file, doc, 1); + g_free(file); - } + //} xmlFreeDoc(doc); @@ -868,7 +869,7 @@ stickynotes_save (void) void stickynotes_load (GdkScreen *screen) { - xmlDocPtr doc; + xmlDocPtr doc = NULL; xmlNodePtr root; xmlNodePtr node; /* WnckScreen *wnck_screen; */ @@ -877,9 +878,28 @@ stickynotes_load (GdkScreen *screen) int x, y, w, h; /* The XML file is $HOME/.config/mate/stickynotes_applet, most probably */ { - gchar *file = g_strdup_printf("%s%s", g_get_home_dir(), - XML_PATH); - doc = xmlParseFile(file); + /* retro-compatibilidad con ~/.mate2/ */ + gchar* file = g_build_filename(g_get_home_dir(), ".config", "mate", "stickynotes-applet.xml", NULL); + + if (g_file_test(file, G_FILE_TEST_EXISTS)) + { + /* load file */ + doc = xmlParseFile(file); + } + else + { + /* 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)) + { + /* load file */ + doc = xmlParseFile(file); + } + } + g_free(file); } |