~bcurtiswx/ubuntu/precise/empathy/3.4.2.1-0ubuntu1

« back to all changes in this revision

Viewing changes to libempathy/empathy-irc-network-manager.c

  • Committer: Bazaar Package Importer
  • Author(s): Laurent Bigonville
  • Date: 2009-11-16 23:40:52 UTC
  • mfrom: (1.1.39 upstream)
  • mto: (6.3.7 experimental)
  • mto: This revision was merged to the branch mainline in revision 80.
  • Revision ID: james.westby@ubuntu.com-20091116234052-7hhwrpeln4mwdyw7
Tags: upstream-2.29.2
ImportĀ upstreamĀ versionĀ 2.29.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
463
463
    {
464
464
      gchar *address = NULL, *port = NULL, *ssl = NULL;
465
465
 
466
 
      if (strcmp (server_node->name, "server") != 0)
 
466
      if (strcmp ((const gchar *) server_node->name, "server") != 0)
467
467
        continue;
468
468
 
469
 
      address = xmlGetProp (server_node, "address");
470
 
      port = xmlGetProp (server_node, "port");
471
 
      ssl = xmlGetProp (server_node, "ssl");
 
469
      address = (gchar *) xmlGetProp (server_node, (const xmlChar *) "address");
 
470
      port = (gchar *) xmlGetProp (server_node, (const xmlChar *) "port");
 
471
      ssl = (gchar *) xmlGetProp (server_node, (const xmlChar *) "ssl");
472
472
 
473
473
      if (address != NULL)
474
474
        {
511
511
  gchar *str;
512
512
  gchar *id, *name;
513
513
 
514
 
  id = xmlGetProp (node, "id");
515
 
  if (xmlHasProp (node, "dropped"))
 
514
  id = (gchar *) xmlGetProp (node, (const xmlChar *) "id");
 
515
  if (xmlHasProp (node, (const xmlChar *) "dropped"))
516
516
    {
517
517
      if (!user_defined)
518
518
        {
529
529
      return;
530
530
    }
531
531
 
532
 
  if (!xmlHasProp (node, "name"))
 
532
  if (!xmlHasProp (node, (const xmlChar *) "name"))
533
533
    return;
534
534
 
535
 
  name = xmlGetProp (node, "name");
 
535
  name = (gchar *) xmlGetProp (node, (const xmlChar *) "name");
536
536
  network = empathy_irc_network_new (name);
537
537
 
538
 
  if (xmlHasProp (node, "network_charset"))
 
538
  if (xmlHasProp (node, (const xmlChar *) "network_charset"))
539
539
    {
540
540
      gchar *charset;
541
 
      charset = xmlGetProp (node, "network_charset");
 
541
      charset = (gchar *) xmlGetProp (node, (const xmlChar *) "network_charset");
542
542
      g_object_set (network, "charset", charset, NULL);
543
543
      xmlFree (charset);
544
544
    }
630
630
    /* no need to write this network to the XML */
631
631
    return;
632
632
 
633
 
  network_node = xmlNewChild (root, NULL, "network", NULL);
634
 
  xmlNewProp (network_node, "id", id);
 
633
  network_node = xmlNewChild (root, NULL, (const xmlChar *) "network", NULL);
 
634
  xmlNewProp (network_node, (const xmlChar *) "id", (const xmlChar *) id);
635
635
 
636
636
  if (network->dropped)
637
637
    {
638
 
      xmlNewProp (network_node, "dropped", "1");
 
638
      xmlNewProp (network_node, (const xmlChar *) "dropped",
 
639
          (const xmlChar *)  "1");
639
640
      return;
640
641
    }
641
642
 
643
644
      "name", &name,
644
645
      "charset", &charset,
645
646
      NULL);
646
 
  xmlNewProp (network_node, "name", name);
647
 
  xmlNewProp (network_node, "network_charset", charset);
 
647
  xmlNewProp (network_node, (const xmlChar *) "name", (const xmlChar *) name);
 
648
  xmlNewProp (network_node, (const xmlChar *) "network_charset",
 
649
      (const xmlChar *) charset);
648
650
  g_free (name);
649
651
  g_free (charset);
650
652
 
651
653
  servers = empathy_irc_network_get_servers (network);
652
654
 
653
 
  servers_node = xmlNewChild (network_node, NULL, "servers", NULL);
 
655
  servers_node = xmlNewChild (network_node, NULL, (const xmlChar *) "servers",
 
656
      NULL);
654
657
  for (l = servers; l != NULL; l = g_slist_next (l))
655
658
    {
656
659
      EmpathyIrcServer *server;
661
664
 
662
665
      server = l->data;
663
666
 
664
 
      server_node = xmlNewChild (servers_node, NULL, "server", NULL);
 
667
      server_node = xmlNewChild (servers_node, NULL, (const xmlChar *) "server",
 
668
          NULL);
665
669
 
666
670
      g_object_get (server,
667
671
          "address", &address,
669
673
          "ssl", &ssl,
670
674
          NULL);
671
675
 
672
 
      xmlNewProp (server_node, "address", address);
 
676
      xmlNewProp (server_node, (const xmlChar *) "address",
 
677
          (const xmlChar *) address);
673
678
 
674
679
      tmp = g_strdup_printf ("%u", port);
675
 
      xmlNewProp (server_node, "port", tmp);
 
680
      xmlNewProp (server_node, (const xmlChar *) "port",
 
681
          (const xmlChar *) tmp);
676
682
      g_free (tmp);
677
683
 
678
 
      xmlNewProp (server_node, "ssl", ssl ? "TRUE": "FALSE");
 
684
      xmlNewProp (server_node, (const xmlChar *) "ssl",
 
685
          ssl ? (const xmlChar *) "TRUE": (const xmlChar *) "FALSE");
679
686
 
680
687
      g_free (address);
681
688
    }
700
707
 
701
708
  DEBUG ("Saving IRC networks");
702
709
 
703
 
  doc = xmlNewDoc ("1.0");
704
 
  root = xmlNewNode (NULL, "networks");
 
710
  doc = xmlNewDoc ((const xmlChar *)  "1.0");
 
711
  root = xmlNewNode (NULL, (const xmlChar *) "networks");
705
712
  xmlDocSetRootElement (doc, root);
706
713
 
707
714
  g_hash_table_foreach (priv->networks, (GHFunc) write_network_to_xml, root);