~ubuntu-branches/ubuntu/saucy/evolution-data-server/saucy

« back to all changes in this revision

Viewing changes to addressbook/libebook/e-destination.c

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2012-10-08 12:58:16 UTC
  • mfrom: (181.1.7 quantal)
  • Revision ID: package-import@ubuntu.com-20121008125816-i3n76e8c0m64e7xp
Tags: 3.6.0-0ubuntu2
* Fix LP: #1038047 part 1 - Don't abort in e_source_registry_new* when a
  problem occurs connecting to the Dbus service
  - add debian/patches/dont-abort-in-e_source_registry_new.patch
  - update debian/patches/series
* Fix LP: #1038047 part 2 - libedataserver depends on
  evolution-data-server-common to ensure that the GSettings schemas are
  present
  - update debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
1321
1321
 
1322
1322
        g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
1323
1323
 
1324
 
        dest_node = xmlNewNode (NULL, (xmlChar*)"destination");
 
1324
        dest_node = xmlNewNode (NULL, (xmlChar *)"destination");
1325
1325
 
1326
1326
        str = e_destination_get_name (dest);
1327
1327
        if (str)
1328
 
                xmlNewTextChild (dest_node, NULL, (xmlChar*)"name", (xmlChar*)str);
 
1328
                xmlNewTextChild (dest_node, NULL, (xmlChar *)"name", (xmlChar *) str);
1329
1329
 
1330
1330
        if (!e_destination_is_evolution_list (dest)) {
1331
1331
                str = e_destination_get_email (dest);
1332
1332
                if (str)
1333
 
                        xmlNewTextChild (dest_node, NULL, (xmlChar*)"email", (xmlChar*)str);
 
1333
                        xmlNewTextChild (dest_node, NULL, (xmlChar *)"email", (xmlChar *) str);
1334
1334
        } else {
1335
1335
                GList *iter = dest->priv->list_dests;
1336
1336
 
1337
1337
                while (iter) {
1338
1338
                        EDestination *list_dest = E_DESTINATION (iter->data);
1339
 
                        xmlNodePtr list_node = xmlNewNode (NULL, (xmlChar*)"list_entry");
 
1339
                        xmlNodePtr list_node = xmlNewNode (NULL, (xmlChar *)"list_entry");
1340
1340
 
1341
1341
                        str = e_destination_get_name (list_dest);
1342
1342
                        if (str) {
1343
1343
                                xmlChar *escaped = xmlEncodeEntitiesReentrant (NULL, (xmlChar *) str);
1344
 
                                xmlNewTextChild (list_node, NULL, (xmlChar*)"name", escaped);
 
1344
                                xmlNewTextChild (list_node, NULL, (xmlChar *)"name", escaped);
1345
1345
                                xmlFree (escaped);
1346
1346
                        }
1347
1347
 
1348
1348
                        str = e_destination_get_email (list_dest);
1349
1349
                        if (str) {
1350
1350
                                xmlChar *escaped = xmlEncodeEntitiesReentrant (NULL, (xmlChar *) str);
1351
 
                                xmlNewTextChild (list_node, NULL, (xmlChar*)"email", escaped);
 
1351
                                xmlNewTextChild (list_node, NULL, (xmlChar *)"email", escaped);
1352
1352
                                xmlFree (escaped);
1353
1353
                        }
1354
1354
 
1357
1357
                        iter = g_list_next (iter);
1358
1358
                }
1359
1359
 
1360
 
                xmlNewProp (dest_node, (xmlChar*)"is_list", (xmlChar*)"yes");
1361
 
                xmlNewProp (dest_node, (xmlChar*)"show_addresses",
1362
 
                            e_destination_list_show_addresses (dest) ? (xmlChar*)"yes" : (xmlChar*)"no");
 
1360
                xmlNewProp (dest_node, (xmlChar *)"is_list", (xmlChar *)"yes");
 
1361
                xmlNewProp (dest_node, (xmlChar *)"show_addresses",
 
1362
                            e_destination_list_show_addresses (dest) ? (xmlChar *)"yes" : (xmlChar *)"no");
1363
1363
        }
1364
1364
 
1365
1365
        str = e_destination_get_source_uid (dest);
1366
1366
        if (str) {
1367
1367
                xmlChar *escaped = xmlEncodeEntitiesReentrant (NULL, (xmlChar *) str);
1368
 
                xmlNewTextChild (dest_node, NULL, (xmlChar*)"source_uid", escaped);
 
1368
                xmlNewTextChild (dest_node, NULL, (xmlChar *)"source_uid", escaped);
1369
1369
                xmlFree (escaped);
1370
1370
        }
1371
1371
 
1373
1373
        if (str) {
1374
1374
                gchar buf[16];
1375
1375
 
1376
 
                xmlNodePtr uri_node = xmlNewTextChild (dest_node, NULL, (xmlChar*)"card_uid", (xmlChar*)str);
 
1376
                xmlNodePtr uri_node = xmlNewTextChild (dest_node, NULL, (xmlChar *)"card_uid", (xmlChar *) str);
1377
1377
                g_snprintf (buf, 16, "%d", e_destination_get_email_num (dest));
1378
 
                xmlNewProp (uri_node, (xmlChar*)"email_num", (xmlChar*)buf);
 
1378
                xmlNewProp (uri_node, (xmlChar *)"email_num", (xmlChar *) buf);
1379
1379
        }
1380
1380
 
1381
 
        xmlNewProp (dest_node, (xmlChar*)"html_mail", e_destination_get_html_mail_pref (dest) ? (xmlChar*)"yes" : (xmlChar*)"no");
 
1381
        xmlNewProp (dest_node, (xmlChar *)"html_mail", e_destination_get_html_mail_pref (dest) ? (xmlChar *)"yes" : (xmlChar *)"no");
1382
1382
 
1383
 
        xmlNewProp (dest_node, (xmlChar*)"auto_recipient",
1384
 
                    e_destination_is_auto_recipient (dest) ? (xmlChar*)"yes" : (xmlChar*)"no");
 
1383
        xmlNewProp (dest_node, (xmlChar *)"auto_recipient",
 
1384
                    e_destination_is_auto_recipient (dest) ? (xmlChar *)"yes" : (xmlChar *)"no");
1385
1385
 
1386
1386
        return dest_node;
1387
1387
}
1410
1410
        g_return_val_if_fail (dest && E_IS_DESTINATION (dest), FALSE);
1411
1411
        g_return_val_if_fail (node != NULL, FALSE);
1412
1412
 
1413
 
        if (strcmp ((gchar *)node->name, "destination"))
 
1413
        if (strcmp ((gchar *) node->name, "destination"))
1414
1414
                return FALSE;
1415
1415
 
1416
 
        tmp = (gchar *)xmlGetProp (node, (xmlChar*)"html_mail");
 
1416
        tmp = (gchar *) xmlGetProp (node, (xmlChar *)"html_mail");
1417
1417
        if (tmp) {
1418
1418
                html_mail = !strcmp (tmp, "yes");
1419
1419
                xmlFree (tmp);
1420
1420
        }
1421
1421
 
1422
 
        tmp = (gchar *)xmlGetProp (node, (xmlChar*)"is_list");
 
1422
        tmp = (gchar *) xmlGetProp (node, (xmlChar *)"is_list");
1423
1423
        if (tmp) {
1424
1424
                is_list = !strcmp (tmp, "yes");
1425
1425
                xmlFree (tmp);
1426
1426
        }
1427
1427
 
1428
 
        tmp = (gchar *)xmlGetProp (node, (xmlChar*)"show_addresses");
 
1428
        tmp = (gchar *) xmlGetProp (node, (xmlChar *)"show_addresses");
1429
1429
        if (tmp) {
1430
1430
                show_addr = !strcmp (tmp, "yes");
1431
1431
                xmlFree (tmp);
1432
1432
        }
1433
1433
 
1434
 
        tmp = (gchar *)xmlGetProp (node, (xmlChar*)"auto_recipient");
 
1434
        tmp = (gchar *) xmlGetProp (node, (xmlChar *)"auto_recipient");
1435
1435
        if (tmp) {
1436
1436
                auto_recip = !strcmp (tmp, "yes");
1437
1437
                xmlFree (tmp);
1439
1439
 
1440
1440
        node = node->xmlChildrenNode;
1441
1441
        while (node) {
1442
 
                if (!strcmp ((gchar *)node->name, "name")) {
 
1442
                if (!strcmp ((gchar *) node->name, "name")) {
1443
1443
                        tmp = (gchar *) xmlNodeGetContent (node);
1444
1444
                        g_free (name);
1445
1445
                        name = g_strdup (tmp);
1446
1446
                        xmlFree (tmp);
1447
 
                } else if (!is_list && !strcmp ((gchar *)node->name, "email")) {
 
1447
                } else if (!is_list && !strcmp ((gchar *) node->name, "email")) {
1448
1448
                        tmp = (gchar *) xmlNodeGetContent (node);
1449
1449
                        g_free (email);
1450
1450
                        email = g_strdup (tmp);
1451
1451
                        xmlFree (tmp);
1452
 
                } else if (is_list && !strcmp ((gchar *)node->name, "list_entry")) {
 
1452
                } else if (is_list && !strcmp ((gchar *) node->name, "list_entry")) {
1453
1453
                        xmlNodePtr subnode = node->xmlChildrenNode;
1454
1454
                        gchar *list_name = NULL, *list_email = NULL;
1455
1455
 
1456
1456
                        while (subnode) {
1457
 
                                if (!strcmp ((gchar *)subnode->name, "name")) {
 
1457
                                if (!strcmp ((gchar *) subnode->name, "name")) {
1458
1458
                                        tmp = (gchar *) xmlNodeGetContent (subnode);
1459
1459
                                        g_free (list_name);
1460
1460
                                        list_name = g_strdup (tmp);
1461
1461
                                        xmlFree (tmp);
1462
 
                                } else if (!strcmp ((gchar *)subnode->name, "email")) {
 
1462
                                } else if (!strcmp ((gchar *) subnode->name, "email")) {
1463
1463
                                        tmp = (gchar *) xmlNodeGetContent (subnode);
1464
1464
                                        g_free (list_email);
1465
1465
                                        list_email = g_strdup (tmp);
1482
1482
 
1483
1483
                                list_dests = g_list_append (list_dests, list_dest);
1484
1484
                        }
1485
 
                } else if (!strcmp ((gchar *)node->name, "source_uid")) {
 
1485
                } else if (!strcmp ((gchar *) node->name, "source_uid")) {
1486
1486
                        tmp = (gchar *) xmlNodeGetContent (node);
1487
1487
                        g_free (source_uid);
1488
1488
                        source_uid = g_strdup (tmp);
1489
1489
                        xmlFree (tmp);
1490
 
                } else if (!strcmp ((gchar *)node->name, "card_uid")) {
 
1490
                } else if (!strcmp ((gchar *) node->name, "card_uid")) {
1491
1491
                        tmp = (gchar *) xmlNodeGetContent (node);
1492
1492
                        g_free (card_uid);
1493
1493
                        card_uid = g_strdup (tmp);
1494
1494
                        xmlFree (tmp);
1495
1495
 
1496
 
                        tmp = (gchar *)xmlGetProp (node, (xmlChar*)"email_num");
 
1496
                        tmp = (gchar *) xmlGetProp (node, (xmlChar *)"email_num");
1497
1497
                        email_num = atoi (tmp);
1498
1498
                        xmlFree (tmp);
1499
1499
                }
1654
1654
                return NULL;
1655
1655
 
1656
1656
        destv_doc  = xmlNewDoc ((xmlChar *) XML_DEFAULT_VERSION);
1657
 
        destv_node = xmlNewNode (NULL, (xmlChar*)"destinations");
 
1657
        destv_node = xmlNewNode (NULL, (xmlChar *)"destinations");
1658
1658
        xmlDocSetRootElement (destv_doc, destv_node);
1659
1659
 
1660
1660
        for (i = 0; destv[i]; i++) {
1701
1701
 
1702
1702
        node = destv_doc->xmlRootNode;
1703
1703
 
1704
 
        if (strcmp ((gchar *)node->name, "destinations"))
 
1704
        if (strcmp ((gchar *) node->name, "destinations"))
1705
1705
                goto finished;
1706
1706
 
1707
1707
        node = node->xmlChildrenNode;