diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-01-31 01:20:16 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-01-31 01:45:55 +0800 |
commit | 763081aa862908e845bc780b784d939a07abd508 (patch) | |
tree | 1a060b3cc1ae28e915348939cbbcdd28416a13b5 /modules | |
parent | 0ff254b3a8946244b645f2ea74316926aa109ab6 (diff) | |
download | gsoc2013-evolution-763081aa862908e845bc780b784d939a07abd508.tar.gz gsoc2013-evolution-763081aa862908e845bc780b784d939a07abd508.tar.zst gsoc2013-evolution-763081aa862908e845bc780b784d939a07abd508.zip |
Fix up error handling around e_book/cal_client_connect_finish().
Diffstat (limited to 'modules')
-rw-r--r-- | modules/addressbook/e-book-shell-backend.c | 8 | ||||
-rw-r--r-- | modules/calendar/e-cal-attachment-handler.c | 12 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-backend.c | 5 | ||||
-rw-r--r-- | modules/calendar/e-memo-shell-backend.c | 5 | ||||
-rw-r--r-- | modules/calendar/e-task-shell-backend.c | 5 | ||||
-rw-r--r-- | modules/itip-formatter/itip-view.c | 23 | ||||
-rw-r--r-- | modules/vcard-inline/e-mail-parser-vcard-inline.c | 4 |
7 files changed, 16 insertions, 46 deletions
diff --git a/modules/addressbook/e-book-shell-backend.c b/modules/addressbook/e-book-shell-backend.c index 3cc5c9d722..4de01f9e1c 100644 --- a/modules/addressbook/e-book-shell-backend.c +++ b/modules/addressbook/e-book-shell-backend.c @@ -108,9 +108,7 @@ book_shell_backend_new_contact_cb (GObject *source_object, /* XXX Handle errors better. */ if (error != NULL) { - g_warning ( - "%s: Failed to open book: %s", - G_STRFUNC, error->message); + g_warning ("%s: %s", G_STRFUNC, error->message); g_error_free (error); goto exit; } @@ -149,9 +147,7 @@ book_shell_backend_new_contact_list_cb (GObject *source_object, /* XXX Handle errors better. */ if (error != NULL) { - g_warning ( - "%s: Failed to open book: %s", - G_STRFUNC, error->message); + g_warning ("%s: %s", G_STRFUNC, error->message); g_error_free (error); goto exit; } diff --git a/modules/calendar/e-cal-attachment-handler.c b/modules/calendar/e-cal-attachment-handler.c index d16f4a6bfc..539a5ba3a4 100644 --- a/modules/calendar/e-cal-attachment-handler.c +++ b/modules/calendar/e-cal-attachment-handler.c @@ -169,7 +169,6 @@ attachment_handler_import_event (GObject *source_object, GAsyncResult *result, gpointer user_data) { - ESource *source = E_SOURCE (source_object); EAttachment *attachment = user_data; EClient *client; icalcomponent *component; @@ -185,10 +184,7 @@ attachment_handler_import_event (GObject *source_object, ((client == NULL) && (error != NULL))); if (error != NULL) { - g_warning ( - "%s: Failed to open '%s': %s", - G_STRFUNC, e_source_get_display_name (source), - error->message); + g_warning ("%s: %s", G_STRFUNC, error->message); g_object_unref (attachment); g_error_free (error); return; @@ -227,7 +223,6 @@ attachment_handler_import_todo (GObject *source_object, GAsyncResult *result, gpointer user_data) { - ESource *source = E_SOURCE (source_object); EAttachment *attachment = user_data; EClient *client; icalcomponent *component; @@ -243,10 +238,7 @@ attachment_handler_import_todo (GObject *source_object, ((client == NULL) && (error != NULL))); if (error != NULL) { - g_warning ( - "%s: Failed to open '%s': %s", - G_STRFUNC, e_source_get_display_name (source), - error->message); + g_warning ("%s: %s", G_STRFUNC, error->message); g_object_unref (attachment); g_error_free (error); return; diff --git a/modules/calendar/e-cal-shell-backend.c b/modules/calendar/e-cal-shell-backend.c index 4d9eee63c4..f2453e9714 100644 --- a/modules/calendar/e-cal-shell-backend.c +++ b/modules/calendar/e-cal-shell-backend.c @@ -83,10 +83,7 @@ cal_shell_backend_new_event (ESource *source, /* XXX Handle errors better. */ if (error != NULL) { - g_warning ( - "%s: Failed to open '%s': %s", - G_STRFUNC, e_source_get_display_name (source), - error->message); + g_warning ("%s: %s", G_STRFUNC, error->message); g_error_free (error); return; } diff --git a/modules/calendar/e-memo-shell-backend.c b/modules/calendar/e-memo-shell-backend.c index 6f3d481d95..7ac64a9bc2 100644 --- a/modules/calendar/e-memo-shell-backend.c +++ b/modules/calendar/e-memo-shell-backend.c @@ -77,10 +77,7 @@ memo_shell_backend_new_memo (ESource *source, /* XXX Handle errors better. */ if (error != NULL) { - g_warning ( - "%s: Failed to open '%s': %s", - G_STRFUNC, e_source_get_display_name (source), - error->message); + g_warning ("%s: %s", G_STRFUNC, error->message); g_error_free (error); return; } diff --git a/modules/calendar/e-task-shell-backend.c b/modules/calendar/e-task-shell-backend.c index 831e35de18..6fbd2afe7f 100644 --- a/modules/calendar/e-task-shell-backend.c +++ b/modules/calendar/e-task-shell-backend.c @@ -75,10 +75,7 @@ task_shell_backend_new_task (ESource *source, /* XXX Handle errors better. */ if (error != NULL) { - g_warning ( - "%s: Failed to open '%s': %s", - G_STRFUNC, e_source_get_display_name (source), - error->message); + g_warning ("%s: %s", G_STRFUNC, error->message); g_error_free (error); return; } diff --git a/modules/itip-formatter/itip-view.c b/modules/itip-formatter/itip-view.c index a996b1e764..1a8742b574 100644 --- a/modules/itip-formatter/itip-view.c +++ b/modules/itip-formatter/itip-view.c @@ -3489,22 +3489,13 @@ set_buttons_sensitive (EMailPartItip *pitip, static void add_failed_to_load_msg (ItipView *view, - ESource *source, const GError *error) { - gchar *msg; - g_return_if_fail (view != NULL); - g_return_if_fail (source != NULL); g_return_if_fail (error != NULL); - /* Translators: The first '%s' is replaced with a calendar name, - * the second '%s' with an error message */ - msg = g_strdup_printf (_("Failed to load the calendar '%s' (%s)"), e_source_get_display_name (source), error->message); - - itip_view_add_lower_info_item (view, ITIP_VIEW_INFO_ITEM_TYPE_WARNING, msg); - - g_free (msg); + itip_view_add_lower_info_item ( + view, ITIP_VIEW_INFO_ITEM_TYPE_WARNING, error->message); } static void @@ -3512,11 +3503,11 @@ cal_opened_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) { - ESource *source = E_SOURCE (source_object); ItipView *view = user_data; EMailPartItip *pitip = itip_view_get_mail_part (view); ECalClientSourceType source_type; EClient *client; + ESource *source; ECalClient *cal_client; const gchar *uid; GError *error = NULL; @@ -3535,7 +3526,7 @@ cal_opened_cb (GObject *source_object, return; } else if (error != NULL) { - add_failed_to_load_msg (view, source, error); + add_failed_to_load_msg (view, error); g_error_free (error); return; } @@ -3543,6 +3534,7 @@ cal_opened_cb (GObject *source_object, cal_client = E_CAL_CLIENT (client); g_return_if_fail (cal_client != NULL); + source = e_client_get_source (client); uid = e_source_get_uid (source); source_type = e_cal_client_get_source_type (cal_client); g_hash_table_insert ( @@ -3984,12 +3976,12 @@ find_cal_opened_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) { - ESource *source = E_SOURCE (source_object); FormatItipFindData *fd = user_data; EMailPartItip *pitip = fd->puri; ItipView *view = fd->view; ECalClientSourceType source_type; EClient *client; + ESource *source; ECalClient *cal_client; gboolean search_for_conflicts = FALSE; const gchar *extension_name; @@ -4021,7 +4013,7 @@ find_cal_opened_cb (GObject *source_object, /* FIXME Do we really want to warn here? If we fail * to find the item, this won't be cleared but the * selector might be shown */ - add_failed_to_load_msg (view, source, error); + add_failed_to_load_msg (view, error); decrease_find_data (fd); g_error_free (error); return; @@ -4037,6 +4029,7 @@ find_cal_opened_cb (GObject *source_object, cal_client = E_CAL_CLIENT (client); source_type = e_cal_client_get_source_type (cal_client); + source = e_client_get_source (client); uid = e_source_get_uid (source); g_hash_table_insert ( pitip->clients[source_type], g_strdup (uid), cal_client); diff --git a/modules/vcard-inline/e-mail-parser-vcard-inline.c b/modules/vcard-inline/e-mail-parser-vcard-inline.c index 2580059b94..00fed5b96a 100644 --- a/modules/vcard-inline/e-mail-parser-vcard-inline.c +++ b/modules/vcard-inline/e-mail-parser-vcard-inline.c @@ -113,9 +113,7 @@ client_connect_cb (GObject *source_object, ((client == NULL) && (error != NULL))); if (error != NULL) { - g_warning ( - "%s: Failed to open book client: %s", - G_STRFUNC, error->message); + g_warning ("%s: %s", G_STRFUNC, error->message); g_error_free (error); goto exit; } |