aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/save-calendar/csv-format.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-01-24 05:05:08 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-01-30 22:35:27 +0800
commitf19241d136043d5cfffbfbaf5b2d6d1affc70682 (patch)
tree6abc10286b092dfc9b046bde599f24767ad0c177 /plugins/save-calendar/csv-format.c
parente583928e0401a4baea4432c5b7e12a1b1eff8c2e (diff)
downloadgsoc2013-evolution-f19241d136043d5cfffbfbaf5b2d6d1affc70682.tar
gsoc2013-evolution-f19241d136043d5cfffbfbaf5b2d6d1affc70682.tar.gz
gsoc2013-evolution-f19241d136043d5cfffbfbaf5b2d6d1affc70682.tar.bz2
gsoc2013-evolution-f19241d136043d5cfffbfbaf5b2d6d1affc70682.tar.lz
gsoc2013-evolution-f19241d136043d5cfffbfbaf5b2d6d1affc70682.tar.xz
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/save-calendar/csv-format.c')
-rw-r--r--plugins/save-calendar/csv-format.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/plugins/save-calendar/csv-format.c b/plugins/save-calendar/csv-format.c
index 872530af16..1e1bf4a7e1 100644
--- a/plugins/save-calendar/csv-format.c
+++ b/plugins/save-calendar/csv-format.c
@@ -318,7 +318,7 @@ do_save_calendar_csv (FormatHandler *handler,
*/
ESource *primary_source;
- ECalClient *source_client;
+ EClient *source_client;
GError *error = NULL;
GSList *objects = NULL;
GOutputStream *stream;
@@ -332,15 +332,19 @@ do_save_calendar_csv (FormatHandler *handler,
/* open source client */
primary_source = e_source_selector_ref_primary_selection (selector);
- source_client = e_cal_client_new (primary_source, type, &error);
+ source_client = e_cal_client_connect_sync (
+ primary_source, type, NULL, &error);
g_object_unref (primary_source);
- if (!source_client || !e_client_open_sync (E_CLIENT (source_client), TRUE, NULL, &error)) {
+ /* Sanity check. */
+ g_return_if_fail (
+ ((source_client != NULL) && (error == NULL)) ||
+ ((source_client == NULL) && (error != NULL)));
+
+ if (source_client == NULL) {
display_error_message (
gtk_widget_get_toplevel (GTK_WIDGET (selector)),
error);
- if (source_client)
- g_object_unref (source_client);
g_error_free (error);
return;
}
@@ -360,7 +364,7 @@ do_save_calendar_csv (FormatHandler *handler,
GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (selector))),
dest_uri, &error);
- if (stream && e_cal_client_get_object_list_as_comps_sync (source_client, "#t", &objects, NULL, NULL)) {
+ if (stream && e_cal_client_get_object_list_as_comps_sync (E_CAL_CLIENT (source_client), "#t", &objects, NULL, NULL)) {
GSList *iter;
if (config->header) {