From 566d861915da77e93b097a927a79f0130de8c535 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 27 Jun 2011 18:04:57 +0200 Subject: Check for cancelled GIO operation error code too --- addressbook/gui/contact-editor/e-contact-editor.c | 13 ++++++++----- addressbook/gui/contact-editor/e-contact-quick-add.c | 8 ++++---- 2 files changed, 12 insertions(+), 9 deletions(-) (limited to 'addressbook/gui/contact-editor') diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 4088837f90..7730f17a53 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -213,7 +213,8 @@ e_contact_editor_contact_added (EABEditor *editor, if (!error) return; - if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED)) + if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) || + g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) return; eab_error_dialog (NULL, _("Error adding contact"), error); @@ -227,7 +228,8 @@ e_contact_editor_contact_modified (EABEditor *editor, if (!error) return; - if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED)) + if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) || + g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) return; eab_error_dialog (NULL, _("Error modifying contact"), error); @@ -241,7 +243,8 @@ e_contact_editor_contact_deleted (EABEditor *editor, if (!error) return; - if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED)) + if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) || + g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) return; eab_error_dialog (NULL, _("Error removing contact"), error); @@ -2983,8 +2986,8 @@ contact_editor_book_loaded_cb (GObject *source_object, if (!e_client_utils_open_new_finish (source, result, &client, &error)) client = NULL; - if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) || - g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED)) { + if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) || + g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { g_warn_if_fail (client == NULL); g_error_free (error); } else if (error != NULL) { diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c index ac46c0ecfc..4de9060f60 100644 --- a/addressbook/gui/contact-editor/e-contact-quick-add.c +++ b/addressbook/gui/contact-editor/e-contact-quick-add.c @@ -132,8 +132,8 @@ merge_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) client = NULL; /* Ignore cancellations. */ - if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) || - g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED)) { + if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) || + g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { g_error_free (error); return; } @@ -277,8 +277,8 @@ ce_have_book (GObject *source_object, GAsyncResult *result, gpointer user_data) client = NULL; /* Ignore cancellations. */ - if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) || - g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED)) { + if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) || + g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { g_error_free (error); return; } -- cgit v1.2.3