diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-01-24 05:05:08 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-01-30 22:35:27 +0800 |
commit | f19241d136043d5cfffbfbaf5b2d6d1affc70682 (patch) | |
tree | 6abc10286b092dfc9b046bde599f24767ad0c177 /plugins/publish-calendar/publish-format-fb.c | |
parent | e583928e0401a4baea4432c5b7e12a1b1eff8c2e (diff) | |
download | gsoc2013-evolution-f19241d136043d5cfffbfbaf5b2d6d1affc70682.tar.gz gsoc2013-evolution-f19241d136043d5cfffbfbaf5b2d6d1affc70682.tar.zst gsoc2013-evolution-f19241d136043d5cfffbfbaf5b2d6d1affc70682.zip |
Use e_cal_client_connect().
Instead of e_client_utils_open_new() or e_cal_client_new().
Diffstat (limited to 'plugins/publish-calendar/publish-format-fb.c')
-rw-r--r-- | plugins/publish-calendar/publish-format-fb.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/plugins/publish-calendar/publish-format-fb.c b/plugins/publish-calendar/publish-format-fb.c index c2ec12e100..9ead6efe0f 100644 --- a/plugins/publish-calendar/publish-format-fb.c +++ b/plugins/publish-calendar/publish-format-fb.c @@ -59,7 +59,7 @@ write_calendar (const gchar *uid, EShell *shell; ESource *source; ESourceRegistry *registry; - ECalClient *client = NULL; + EClient *client = NULL; GSList *objects = NULL; icaltimezone *utc; time_t start = time (NULL), end; @@ -89,21 +89,21 @@ write_calendar (const gchar *uid, source = e_source_registry_ref_source (registry, uid); if (source != NULL) { - client = e_cal_client_new (source, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, error); + client = e_cal_client_connect_sync ( + source, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, + NULL, error); g_object_unref (source); - } - if (!client) { - if (error && !*error) - *error = g_error_new (E_CAL_CLIENT_ERROR, E_CAL_CLIENT_ERROR_NO_SUCH_CALENDAR, _("Could not publish calendar: Calendar backend no longer exists")); - return FALSE; + } else { + g_set_error ( + error, E_CAL_CLIENT_ERROR, + E_CAL_CLIENT_ERROR_NO_SUCH_CALENDAR, + _("Invalid source UID '%s'"), uid); } - if (!e_client_open_sync (E_CLIENT (client), TRUE, NULL, error)) { - g_object_unref (client); + if (client == NULL) return FALSE; - } - if (e_client_get_backend_property_sync (E_CLIENT (client), CAL_BACKEND_PROPERTY_CAL_EMAIL_ADDRESS, &email, NULL, NULL)) { + if (e_client_get_backend_property_sync (client, CAL_BACKEND_PROPERTY_CAL_EMAIL_ADDRESS, &email, NULL, NULL)) { if (email && *email) users = g_slist_append (users, email); } @@ -114,7 +114,7 @@ write_calendar (const gchar *uid, client, "free-busy-data", G_CALLBACK (free_busy_data_cb), &objects); - if (e_cal_client_get_free_busy_sync (client, start, end, users, NULL, error)) { + if (e_cal_client_get_free_busy_sync (E_CAL_CLIENT (client), start, end, users, NULL, error)) { gchar *ical_string; GSList *iter; |