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

« back to all changes in this revision

Viewing changes to services/evolution-source-registry/evolution-source-registry-migrate-sources.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:
1024
1024
                g_datalist_set_data_full (&url->params, key, value, g_free);
1025
1025
        }
1026
1026
 
 
1027
        /* missing "security-method" means STARTTLS, as it was the default value in 3.4- */
 
1028
        if (!g_datalist_get_data (&url->params, "security-method")) {
 
1029
                GEnumClass *enum_class;
 
1030
                GEnumValue *enum_value;
 
1031
                gchar *value = NULL;
 
1032
 
 
1033
                enum_class = g_type_class_ref (CAMEL_TYPE_NETWORK_SECURITY_METHOD);
 
1034
                enum_value = g_enum_get_value (enum_class,
 
1035
                        CAMEL_NETWORK_SECURITY_METHOD_STARTTLS_ON_STANDARD_PORT);
 
1036
                if (enum_value != NULL) {
 
1037
                        value = g_strdup (enum_value->value_nick);
 
1038
                } else
 
1039
                        g_warn_if_reached ();
 
1040
                g_type_class_unref (enum_class);
 
1041
 
 
1042
                g_datalist_set_data_full (&url->params, "security-method", value, g_free);
 
1043
        }
 
1044
 
1027
1045
        /* A few more adjustments...
1028
1046
         *
1029
1047
         * These are all CAMEL_PROVIDER_CONF_CHECKSPIN settings.  The spin
1871
1889
                        break;
1872
1890
 
1873
1891
                case PARSE_STATE_IN_MAIL_SOURCE_URL:
 
1892
                        /* XXX Workaround for so-called "send-only"
 
1893
                         *     accounts, which have no source URL.
 
1894
                         *     Their backend name is "none". */
 
1895
                        if (text != NULL && *text == '\0')
 
1896
                                text = "none:";
 
1897
 
1874
1898
                        migrate_parse_url (
1875
1899
                                parse_data,
1876
1900
                                parse_data->key_file,
2248
2272
                        E_SOURCE_EXTENSION_WEBDAV_BACKEND,
2249
2273
                        "ResourcePath", parse_data->soup_uri->path);
2250
2274
 
 
2275
        if (parse_data->soup_uri->query != NULL)
 
2276
                g_key_file_set_string (
 
2277
                        parse_data->key_file,
 
2278
                        E_SOURCE_EXTENSION_WEBDAV_BACKEND,
 
2279
                        "ResourceQuery", parse_data->soup_uri->query);
 
2280
 
2251
2281
        parse_data->property_func = migrate_parse_caldav_property;
2252
2282
}
2253
2283
 
2496
2526
                        E_SOURCE_EXTENSION_WEBDAV_BACKEND,
2497
2527
                        "ResourcePath", parse_data->soup_uri->path);
2498
2528
 
 
2529
        if (parse_data->soup_uri->query != NULL)
 
2530
                g_key_file_set_string (
 
2531
                        parse_data->key_file,
 
2532
                        E_SOURCE_EXTENSION_WEBDAV_BACKEND,
 
2533
                        "ResourceQuery", parse_data->soup_uri->query);
 
2534
 
2499
2535
        /* Webcal Backend has no special properties to parse. */
2500
2536
}
2501
2537
 
2540
2576
                        E_SOURCE_EXTENSION_WEBDAV_BACKEND,
2541
2577
                        "ResourcePath", parse_data->soup_uri->path);
2542
2578
 
 
2579
        if (parse_data->soup_uri->query != NULL)
 
2580
                g_key_file_set_string (
 
2581
                        parse_data->key_file,
 
2582
                        E_SOURCE_EXTENSION_WEBDAV_BACKEND,
 
2583
                        "ResourceQuery", parse_data->soup_uri->query);
 
2584
 
2543
2585
        parse_data->property_func = migrate_parse_webdav_property;
2544
2586
}
2545
2587
 
3156
3198
                if (success && g_strcmp0 (name, "accounts") == 0)
3157
3199
                        parse_data->state = PARSE_STATE_IN_ACCOUNTS_ENTRY;
3158
3200
 
3159
 
                if (success && g_strcmp0 (name, "signatues") == 0)
 
3201
                if (success && g_strcmp0 (name, "signatures") == 0)
3160
3202
                        parse_data->state = PARSE_STATE_IN_SIGNATURES_ENTRY;
3161
3203
 
3162
3204
                if (success && g_strcmp0 (name, "sources") == 0)
3358
3400
        }
3359
3401
}
3360
3402
 
 
3403
static void
 
3404
migrate_handle_error (const GError *error)
 
3405
{
 
3406
        g_return_if_fail (error != NULL);
 
3407
 
 
3408
        if (!g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
 
3409
                g_printerr ("  FAILED: %s\n", error->message);
 
3410
}
 
3411
 
3361
3412
void
3362
3413
evolution_source_registry_migrate_sources (void)
3363
3414
{
3390
3441
                gconf_key = "/apps/evolution/mail/accounts";
3391
3442
                migrate_remove_gconf_xml (gconf_key, gconf_xml);
3392
3443
        } else {
3393
 
                g_printerr ("  FAILED: %s\n", error->message);
 
3444
                migrate_handle_error (error);
3394
3445
                g_clear_error (&error);
3395
3446
        }
3396
3447
 
3415
3466
                gconf_key = "/apps/evolution/addressbook/sources";
3416
3467
                migrate_remove_gconf_xml (gconf_key, gconf_xml);
3417
3468
        } else {
3418
 
                g_printerr ("  FAILED: %s\n", error->message);
 
3469
                migrate_handle_error (error);
3419
3470
                g_clear_error (&error);
3420
3471
        }
3421
3472
 
3440
3491
                gconf_key = "/apps/evolution/calendar/sources";
3441
3492
                migrate_remove_gconf_xml (gconf_key, gconf_xml);
3442
3493
        } else {
3443
 
                g_printerr ("  FAILED: %s\n", error->message);
 
3494
                migrate_handle_error (error);
3444
3495
                g_clear_error (&error);
3445
3496
        }
3446
3497
 
3465
3516
                gconf_key = "/apps/evolution/tasks/sources";
3466
3517
                migrate_remove_gconf_xml (gconf_key, gconf_xml);
3467
3518
        } else {
3468
 
                g_printerr ("  FAILED: %s\n", error->message);
 
3519
                migrate_handle_error (error);
3469
3520
                g_clear_error (&error);
3470
3521
        }
3471
3522
 
3490
3541
                gconf_key = "/apps/evolution/memos/sources";
3491
3542
                migrate_remove_gconf_xml (gconf_key, gconf_xml);
3492
3543
        } else {
3493
 
                g_printerr ("  FAILED: %s\n", error->message);
 
3544
                migrate_handle_error (error);
3494
3545
                g_clear_error (&error);
3495
3546
        }
3496
3547