diff options
author | Milan Crha <mcrha@redhat.com> | 2011-06-28 00:04:57 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2011-06-28 00:04:57 +0800 |
commit | 566d861915da77e93b097a927a79f0130de8c535 (patch) | |
tree | 62226a7396bd10080d12f0d69262251aa45e34c2 /plugins/itip-formatter | |
parent | 05933ef483635b84514eb285d4d839b87c3b3afb (diff) | |
download | gsoc2013-evolution-566d861915da77e93b097a927a79f0130de8c535.tar.gz gsoc2013-evolution-566d861915da77e93b097a927a79f0130de8c535.tar.zst gsoc2013-evolution-566d861915da77e93b097a927a79f0130de8c535.zip |
Check for cancelled GIO operation error code too
Diffstat (limited to 'plugins/itip-formatter')
-rw-r--r-- | plugins/itip-formatter/itip-formatter.c | 43 |
1 files changed, 26 insertions, 17 deletions
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; |