summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorVictor Toso <me@victortoso.com>2016-05-25 21:51:52 +0200
committerVictor Toso <me@victortoso.com>2016-06-16 14:59:09 +0200
commit1a89d35172abe0e7344f7f99f9802bfba1177a9a (patch)
tree0eff26d57b5d1804722ed244ed59c45251b64ec6 /libs
parentfc631058c7073c9a22849f0f4a439ce38caa7940 (diff)
downloadgrilo-1a89d35172abe0e7344f7f99f9802bfba1177a9a.tar.gz
net: use G_IO_ERROR on cancelled operation
By deprecating GRL_NET_WC_ERROR_CANCELLED we can use G_IO_ERROR_CANCELLED instead. https://bugzilla.gnome.org/show_bug.cgi?id=764077
Diffstat (limited to 'libs')
-rw-r--r--libs/net/grl-net-wc.c10
-rw-r--r--libs/net/grl-net-wc.h3
2 files changed, 7 insertions, 6 deletions
diff --git a/libs/net/grl-net-wc.c b/libs/net/grl-net-wc.c
index 2cb20fa..c798847 100644
--- a/libs/net/grl-net-wc.c
+++ b/libs/net/grl-net-wc.c
@@ -482,8 +482,8 @@ parse_error (guint status,
response);
return;
case SOUP_STATUS_CANCELLED:
- g_simple_async_result_set_error (result, GRL_NET_WC_ERROR,
- GRL_NET_WC_ERROR_CANCELLED,
+ g_simple_async_result_set_error (result, G_IO_ERROR,
+ G_IO_ERROR_CANCELLED,
_("Operation was cancelled"));
return;
default:
@@ -590,9 +590,9 @@ read_async_cb (GObject *source,
g_object_unref (source);
if (error) {
- if (error->code == G_IO_ERROR_CANCELLED) {
- g_simple_async_result_set_error (result, GRL_NET_WC_ERROR,
- GRL_NET_WC_ERROR_CANCELLED,
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+ g_simple_async_result_set_error (result, G_IO_ERROR,
+ G_IO_ERROR_CANCELLED,
_("Operation was cancelled"));
} else {
g_simple_async_result_set_error (result, GRL_NET_WC_ERROR,
diff --git a/libs/net/grl-net-wc.h b/libs/net/grl-net-wc.h
index 8d660ac..d28fb77 100644
--- a/libs/net/grl-net-wc.h
+++ b/libs/net/grl-net-wc.h
@@ -43,7 +43,8 @@ G_BEGIN_DECLS
* @GRL_NET_WC_ERROR_NETWORK_ERROR: Cannot connect to the server
* @GRL_NET_WC_ERROR_PROXY_ERROR: Deprecated. You should check for
* G_IO_ERROR_PROXY_FAILED from G_IO_ERROR domain.
- * @GRL_NET_WC_ERROR_CANCELLED: The operation has been cancelled (see #GCancellable)
+ * @GRL_NET_WC_ERROR_CANCELLED: Deprecated. You should check for
+ * G_IO_ERROR_CANCELLED from G_IO_ERROR domain.
*
* These constants identify all the available errors managed by
* the web client.