aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-06-28 00:04:57 +0800
committerMilan Crha <mcrha@redhat.com>2011-06-28 00:04:57 +0800
commit566d861915da77e93b097a927a79f0130de8c535 (patch)
tree62226a7396bd10080d12f0d69262251aa45e34c2
parent05933ef483635b84514eb285d4d839b87c3b3afb (diff)
downloadgsoc2013-evolution-566d861915da77e93b097a927a79f0130de8c535.tar
gsoc2013-evolution-566d861915da77e93b097a927a79f0130de8c535.tar.gz
gsoc2013-evolution-566d861915da77e93b097a927a79f0130de8c535.tar.bz2
gsoc2013-evolution-566d861915da77e93b097a927a79f0130de8c535.tar.lz
gsoc2013-evolution-566d861915da77e93b097a927a79f0130de8c535.tar.xz
gsoc2013-evolution-566d861915da77e93b097a927a79f0130de8c535.tar.zst
gsoc2013-evolution-566d861915da77e93b097a927a79f0130de8c535.zip
Check for cancelled GIO operation error code too
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c13
-rw-r--r--addressbook/gui/contact-editor/e-contact-quick-add.c8
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor.c9
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c3
-rw-r--r--addressbook/gui/widgets/eab-gui-util.c7
-rw-r--r--calendar/gui/dialogs/comp-editor.c3
-rw-r--r--mail/em-utils.c11
-rw-r--r--modules/calendar/e-cal-shell-sidebar.c4
-rw-r--r--modules/calendar/e-memo-shell-sidebar.c4
-rw-r--r--modules/calendar/e-task-shell-sidebar.c4
-rw-r--r--plugins/itip-formatter/itip-formatter.c43
11 files changed, 65 insertions, 44 deletions
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;
}
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
index a6a9ceca15..dc51011327 100644
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c
+++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
@@ -1410,7 +1410,8 @@ contact_list_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 list"), error);
@@ -1424,7 +1425,8 @@ contact_list_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 list"), error);
@@ -1438,7 +1440,8 @@ contact_list_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 list"), error);
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index 00f106ea40..1de028c9fa 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -1259,7 +1259,8 @@ report_and_free_error_if_any (GError *error)
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)) {
g_error_free (error);
return;
}
diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c
index 359c104c89..7b94c85233 100644
--- a/addressbook/gui/widgets/eab-gui-util.c
+++ b/addressbook/gui/widgets/eab-gui-util.c
@@ -441,11 +441,12 @@ contact_added_cb (EBookClient *book_client, const GError *error, const gchar *id
{
ContactCopyProcess *process = user_data;
- if (error && !g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED)) {
+ if (error && !g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) &&
+ !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
process->book_status = FALSE;
eab_error_dialog (process->alert_sink, _("Error adding contact"), error);
- }
- else if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED)) {
+ } else if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) ||
+ g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
process->book_status = FALSE;
}
else {
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index da7759523e..88b8b4a89f 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -378,7 +378,8 @@ changes_view_ready_cb (GObject *source_object, GAsyncResult *result, gpointer us
g_error_free (error);
}
} else if (error) {
- 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))
g_debug ("%s: Failed to get view: %s", G_STRFUNC, error->message);
g_error_free (error);
}
diff --git a/mail/em-utils.c b/mail/em-utils.c
index db6bd958f9..3239b87214 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -1654,7 +1654,8 @@ search_address_in_addressbooks (const gchar *address,
book_client = e_book_client_new (source, &err);
if (book_client == NULL) {
- if (err && g_error_matches (err, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED)) {
+ if (err && (g_error_matches (err, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) ||
+ g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CANCELLED))) {
stop = TRUE;
} else if (err) {
gchar *source_uid;
@@ -1677,7 +1678,8 @@ search_address_in_addressbooks (const gchar *address,
g_object_unref (book_client);
book_client = NULL;
- if (err && g_error_matches (err, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED)) {
+ if (err && (g_error_matches (err, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) ||
+ g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CANCELLED))) {
stop = TRUE;
} else if (err) {
gchar *source_uid;
@@ -1724,8 +1726,9 @@ search_address_in_addressbooks (const gchar *address,
g_slist_free (contacts);
}
} else if (book_client) {
- stop = stop || (err && g_error_matches (
- err, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED));
+ stop = stop || (err &&
+ (g_error_matches (err, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) ||
+ g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CANCELLED)));
if (err && !stop) {
gchar *source_uid = g_strdup (e_source_peek_uid (source));
diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c
index efa233e019..e296f6ff31 100644
--- a/modules/calendar/e-cal-shell-sidebar.c
+++ b/modules/calendar/e-cal-shell-sidebar.c
@@ -325,8 +325,8 @@ cal_shell_sidebar_default_loaded_cb (GObject *source_object, GAsyncResult *resul
if (!e_client_utils_open_new_finish (E_SOURCE (source_object), 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_error_free (error);
goto exit;
}
diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c
index 01806199bb..cf38c219b5 100644
--- a/modules/calendar/e-memo-shell-sidebar.c
+++ b/modules/calendar/e-memo-shell-sidebar.c
@@ -319,8 +319,8 @@ memo_shell_sidebar_default_loaded_cb (GObject *source_object, GAsyncResult *resu
if (!e_client_utils_open_new_finish (E_SOURCE (source_object), 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_error_free (error);
goto exit;
}
diff --git a/modules/calendar/e-task-shell-sidebar.c b/modules/calendar/e-task-shell-sidebar.c
index dbb1ba9014..3e693afd7e 100644
--- a/modules/calendar/e-task-shell-sidebar.c
+++ b/modules/calendar/e-task-shell-sidebar.c
@@ -319,8 +319,8 @@ task_shell_sidebar_default_loaded_cb (GObject *source_object, GAsyncResult *resu
if (!e_client_utils_open_new_finish (E_SOURCE (source_object), 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_error_free (error);
goto exit;
}
diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c
index a04001f708..611324d05e 100644
--- a/plugins/itip-formatter/itip-formatter.c
+++ b/plugins/itip-formatter/itip-formatter.c
@@ -508,7 +508,8 @@ cal_opened_cb (GObject *source_object, GAsyncResult *result, gpointer user_data)
if (!e_client_utils_open_new_finish (source, result, &client, &error)) {
client = NULL;
- 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)) {
g_error_free (error);
return;
}
@@ -801,6 +802,16 @@ get_object_without_rid_ready_cb (GObject *source_object, GAsyncResult *result, g
if (!e_cal_client_get_object_finish (cal_client, result, &icalcomp, &error))
icalcomp = NULL;
+ 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);
+ find_cal_update_ui (fd, cal_client);
+ decrease_find_data (fd);
+ return;
+ }
+
+ g_clear_error (&error);
+
if (icalcomp) {
fd->puri->current_client = cal_client;
fd->keep_alarm_check = (fd->puri->method == ICAL_METHOD_PUBLISH || fd->puri->method == ICAL_METHOD_REQUEST) &&
@@ -816,9 +827,6 @@ get_object_without_rid_ready_cb (GObject *source_object, GAsyncResult *result, g
return;
}
- if (error)
- g_error_free (error);
-
find_cal_update_ui (fd, cal_client);
decrease_find_data (fd);
}
@@ -834,6 +842,16 @@ get_object_with_rid_ready_cb (GObject *source_object, GAsyncResult *result, gpoi
if (!e_cal_client_get_object_finish (cal_client, result, &icalcomp, &error))
icalcomp = NULL;
+ 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);
+ find_cal_update_ui (fd, cal_client);
+ decrease_find_data (fd);
+ return;
+ }
+
+ g_clear_error (&error);
+
if (icalcomp) {
fd->puri->current_client = cal_client;
fd->keep_alarm_check = (fd->puri->method == ICAL_METHOD_PUBLISH || fd->puri->method == ICAL_METHOD_REQUEST) &&
@@ -849,17 +867,6 @@ get_object_with_rid_ready_cb (GObject *source_object, GAsyncResult *result, gpoi
return;
}
- if (error) {
- if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED)) {
- g_error_free (error);
- find_cal_update_ui (fd, cal_client);
- decrease_find_data (fd);
- return;
- }
-
- g_error_free (error);
- }
-
if (fd->rid && *fd->rid) {
e_cal_client_get_object (cal_client, fd->uid, NULL, fd->cancellable, get_object_without_rid_ready_cb, fd);
return;
@@ -881,7 +888,8 @@ get_object_list_ready_cb (GObject *source_object, GAsyncResult *result, gpointer
objects = NULL;
if (error) {
- 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)) {
g_error_free (error);
decrease_find_data (fd);
return;
@@ -910,7 +918,8 @@ find_cal_opened_cb (GObject *source_object, GAsyncResult *result, gpointer user_
source = E_SOURCE (source_object);
if (!e_client_utils_open_new_finish (source, result, &client, &error)) {
- 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)) {
g_error_free (error);
decrease_find_data (fd);
return;