]> git.0d.be Git - empathy.git/blobdiff - libempathy/empathy-contact-groups.c
Updated Polish translation
[empathy.git] / libempathy / empathy-contact-groups.c
index b71cf6642a4fa98c63ecf4c8c5a430f1ec7734c8..726824ea43ad03adfbc9a9ad49d5d91a505214cb 100644 (file)
@@ -14,8 +14,8 @@
  *
  * You should have received a copy of the GNU General Public
  * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
  *
  * Authors: Martyn Russell <martyn@imendio.com>
  */
 #include <sys/stat.h>
 
 #include <glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
 
 #include <libxml/parser.h>
 #include <libxml/tree.h>
 
-#include "empathy-debug.h"
 #include "empathy-utils.h"
 #include "empathy-contact-groups.h"
 
-#define DEBUG_DOMAIN "ContactGroups"
+#define DEBUG_FLAG EMPATHY_DEBUG_CONTACT
+#include "empathy-debug.h"
 
 #define CONTACT_GROUPS_XML_FILENAME "contact-groups.xml"
 #define CONTACT_GROUPS_DTD_FILENAME "empathy-contact-groups.dtd"
@@ -67,7 +67,7 @@ empathy_contact_groups_get_all (void)
                groups = 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);
        file_with_path = g_build_filename (dir, CONTACT_GROUPS_XML_FILENAME, NULL);
        g_free (dir);
 
@@ -87,7 +87,7 @@ contact_groups_file_parse (const gchar *filename)
        xmlNodePtr       account;
        xmlNodePtr       node;
 
-       empathy_debug (DEBUG_DOMAIN, "Attempting to parse file:'%s'...", filename);
+       DEBUG ("Attempting to parse file:'%s'...", filename);
 
        ctxt = xmlNewParserCtxt ();
 
@@ -101,7 +101,7 @@ contact_groups_file_parse (const gchar *filename)
 
        if (!empathy_xml_validate (doc, CONTACT_GROUPS_DTD_FILENAME)) {
                g_warning ("Failed to validate file:'%s'", filename);
-               xmlFreeDoc(doc);
+               xmlFreeDoc (doc);
                xmlFreeParserCtxt (ctxt);
                return;
        }
@@ -131,8 +131,8 @@ contact_groups_file_parse (const gchar *filename)
                        gboolean      expanded;
                        ContactGroup *contact_group;
 
-                       name = (gchar *) xmlGetProp (node, "name");
-                       expanded_str = (gchar *) xmlGetProp (node, "expanded");
+                       name = (gchar *) xmlGetProp (node, (const xmlChar *) "name");
+                       expanded_str = (gchar *) xmlGetProp (node, (const xmlChar *) "expanded");
 
                        if (expanded_str && strcmp (expanded_str, "yes") == 0) {
                                expanded = TRUE;
@@ -150,9 +150,9 @@ contact_groups_file_parse (const gchar *filename)
                node = node->next;
        }
 
-       empathy_debug (DEBUG_DOMAIN, "Parsed %d contact groups", g_list_length (groups));
+       DEBUG ("Parsed %d contact groups", g_list_length (groups));
 
-       xmlFreeDoc(doc);
+       xmlFreeDoc (doc);
        xmlFreeParserCtxt (ctxt);
 }
 
@@ -190,17 +190,17 @@ contact_groups_file_save (void)
        gchar      *dir;
        gchar      *file;
 
-       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, CONTACT_GROUPS_XML_FILENAME, NULL);
        g_free (dir);
 
-       doc = xmlNewDoc ("1.0");
-       root = xmlNewNode (NULL, "contacts");
+       doc = xmlNewDoc ((const xmlChar *) "1.0");
+       root = xmlNewNode (NULL, (const xmlChar *) "contacts");
        xmlDocSetRootElement (doc, root);
 
-       node = xmlNewChild (root, NULL, "account", NULL);
-       xmlNewProp (node, "name", "Default");
+       node = xmlNewChild (root, NULL, (const xmlChar *) "account", NULL);
+       xmlNewProp (node, (const xmlChar *) "name", (const xmlChar *) "Default");
 
        for (l = groups; l; l = l->next) {
                ContactGroup *cg;
@@ -208,19 +208,19 @@ contact_groups_file_save (void)
 
                cg = l->data;
 
-               subnode = xmlNewChild (node, NULL, "group", NULL);
-               xmlNewProp (subnode, "expanded", cg->expanded ? "yes" : "no");
-               xmlNewProp (subnode, "name", cg->name);
+               subnode = xmlNewChild (node, NULL, (const xmlChar *) "group", NULL);
+               xmlNewProp (subnode, (const xmlChar *) "expanded", cg->expanded ?
+                               (const xmlChar *) "yes" : (const xmlChar *) "no");
+               xmlNewProp (subnode, (const xmlChar *) "name", (const xmlChar *) cg->name);
        }
 
        /* Make sure the XML is indented properly */
        xmlIndentTreeOutput = 1;
 
-       empathy_debug (DEBUG_DOMAIN, "Saving file:'%s'", file);
+       DEBUG ("Saving file:'%s'", file);
        xmlSaveFormatFileEnc (file, doc, "utf-8", 1);
        xmlFreeDoc (doc);
 
-       xmlCleanupParser ();
        xmlMemoryDump ();
 
        g_free (file);
@@ -262,7 +262,7 @@ empathy_contact_group_set_expanded (const gchar *group,
        g_return_if_fail (group != NULL);
 
        for (l = groups; l; l = l->next) {
-               ContactGroup *cg = l->data;
+               cg = l->data;
 
                if (!cg || !cg->name) {
                        continue;