summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-03-30 11:58:56 +0200
committerOlivier CrĂȘte <olivier.crete@collabora.co.uk>2011-03-30 12:50:20 -0400
commit46ca2ac0eed485bf92007c95f1e2a8d6603b28d5 (patch)
tree5990a7294554ce1eeae38cabefcd0d60e982f4fb
parentc71b1f30dbad61d3a3704bbe567d3c3dcd0d8beb (diff)
async_method_callback_optional: use g_error_matches()
Also use early returns to make things easier to read.
-rw-r--r--telepathy-farsight/stream.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/telepathy-farsight/stream.c b/telepathy-farsight/stream.c
index 8660282..d8e492b 100644
--- a/telepathy-farsight/stream.c
+++ b/telepathy-farsight/stream.c
@@ -1051,10 +1051,13 @@ async_method_callback_optional (TpMediaStreamHandler *proxy G_GNUC_UNUSED,
gpointer user_data,
GObject *weak_object)
{
- if (error != NULL &&
- !(error->domain == DBUS_GERROR &&
- error->code == G_DBUS_ERROR_UNKNOWN_METHOD))
- async_method_callback (proxy, error, user_data, weak_object);
+ if (error == NULL)
+ return;
+
+ if (g_error_matches (error, DBUS_GERROR, G_DBUS_ERROR_UNKNOWN_METHOD))
+ return;
+
+ async_method_callback (proxy, error, user_data, weak_object);
}
static void