aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-06-28 00:04:57 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:42:34 +0800
commitadc1173159d4d5d953340f8f3c813681007de524 (patch)
tree8a0bfc8e9a11e3489f4def2bbb7fe0a4bd645aa2 /addressbook
parent8894b72f2045388990b5696f3e8db97b9544ccf4 (diff)
downloadgsoc2013-evolution-adc1173159d4d5d953340f8f3c813681007de524.tar
gsoc2013-evolution-adc1173159d4d5d953340f8f3c813681007de524.tar.gz
gsoc2013-evolution-adc1173159d4d5d953340f8f3c813681007de524.tar.bz2
gsoc2013-evolution-adc1173159d4d5d953340f8f3c813681007de524.tar.lz
gsoc2013-evolution-adc1173159d4d5d953340f8f3c813681007de524.tar.xz
gsoc2013-evolution-adc1173159d4d5d953340f8f3c813681007de524.tar.zst
gsoc2013-evolution-adc1173159d4d5d953340f8f3c813681007de524.zip
Check for cancelled GIO operation error code too
Diffstat (limited to 'addressbook')
-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
5 files changed, 24 insertions, 16 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 {