]> git.0d.be Git - empathy.git/blobdiff - libempathy/empathy-status-presets.c
Merge branch 'sasl'
[empathy.git] / libempathy / empathy-status-presets.c
index 135212cc5a50e452fee3218f4f803dff98f7d633..319ca53d9073770af24834f231b7f4f4b79e9f67 100644 (file)
@@ -127,7 +127,7 @@ status_presets_file_parse (const gchar *filename)
                        }
 
                        status = (gchar *) xmlNodeGetContent (node);
-                       state_str = (gchar *) xmlGetProp (node, "presence");
+                       state_str = (gchar *) xmlGetProp (node, (const xmlChar *) "presence");
 
                        if (state_str) {
                                state = empathy_presence_from_str (state_str);
@@ -176,7 +176,7 @@ empathy_status_presets_get_all (void)
                presets = NULL;
        }
 
-       dir = g_build_filename (g_get_home_dir (), ".gnome2", PACKAGE_NAME, NULL);
+       dir = g_build_filename (g_get_user_config_dir (), PACKAGE_NAME, NULL);
        g_mkdir_with_parents (dir, S_IRUSR | S_IWUSR | S_IXUSR);
        file_with_path = g_build_filename (dir, STATUS_PRESETS_XML_FILENAME, NULL);
        g_free (dir);
@@ -203,24 +203,24 @@ status_presets_file_save (void)
                count[i] = 0;
        }
 
-       dir = g_build_filename (g_get_home_dir (), ".gnome2", PACKAGE_NAME, NULL);
+       dir = g_build_filename (g_get_user_config_dir (), PACKAGE_NAME, NULL);
        g_mkdir_with_parents (dir, S_IRUSR | S_IWUSR | S_IXUSR);
        file = g_build_filename (dir, STATUS_PRESETS_XML_FILENAME, NULL);
        g_free (dir);
 
-       doc = xmlNewDoc ("1.0");
-       root = xmlNewNode (NULL, "presets");
+       doc = xmlNewDoc ((const xmlChar *) "1.0");
+       root = xmlNewNode (NULL, (const xmlChar *) "presets");
        xmlDocSetRootElement (doc, root);
 
        if (default_preset) {
                xmlNodePtr  subnode;
                xmlChar    *state;
 
-               state = (gchar *) empathy_presence_to_str (default_preset->state);
+               state = (xmlChar *) empathy_presence_to_str (default_preset->state);
 
-               subnode = xmlNewTextChild (root, NULL, "default",
-                                          default_preset->status);
-               xmlNewProp (subnode, "presence", state);
+               subnode = xmlNewTextChild (root, NULL, (const xmlChar *) "default",
+                                         (const xmlChar *) default_preset->status);
+               xmlNewProp (subnode, (const xmlChar *) "presence", state);
        }
 
        for (l = presets; l; l = l->next) {
@@ -229,7 +229,7 @@ status_presets_file_save (void)
                xmlChar      *state;
 
                sp = l->data;
-               state = (gchar *) empathy_presence_to_str (sp->state);
+               state = (xmlChar *) empathy_presence_to_str (sp->state);
 
                count[sp->state]++;
                if (count[sp->state] > STATUS_PRESETS_MAX_EACH) {
@@ -237,8 +237,8 @@ status_presets_file_save (void)
                }
 
                subnode = xmlNewTextChild (root, NULL,
-                                          "status", sp->status);
-               xmlNewProp (subnode, "presence", state);
+                                          (const xmlChar *) "status", (const xmlChar *) sp->status);
+               xmlNewProp (subnode, (const xmlChar *) "presence", state);
        }
 
        /* Make sure the XML is indented properly */
@@ -431,6 +431,8 @@ empathy_status_presets_is_valid (TpConnectionPresenceType state)
                case TP_CONNECTION_PRESENCE_TYPE_HIDDEN:
                case TP_CONNECTION_PRESENCE_TYPE_BUSY:
                        return TRUE;
+
+               default:
+                       return FALSE;
        }
-       return FALSE;
 }