summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stefw@collabora.co.uk>2011-03-23 10:58:43 +0100
committerStef Walter <stefw@collabora.co.uk>2011-03-23 11:10:40 +0100
commit7be06a577234e467a82f259b4db81b14c7a801fd (patch)
tree0eacc4dfe674103101307d59f326080d86b89b5c
parent59ac2219bd44399949c6732dafa402786b317404 (diff)
Hold off on depending on gio 2.28 just for one function.
Replace g_simple_async_result_take_error() with g_simple_async_result_set_error() and g_simple_async_result_set_from_error()
-rw-r--r--configure.ac2
-rw-r--r--wocky/wocky-ll-connection-factory.c11
-rw-r--r--wocky/wocky-ll-connector.c27
-rw-r--r--wocky/wocky-meta-porter.c14
-rw-r--r--wocky/wocky-uninstalled.pc.in2
5 files changed, 27 insertions, 29 deletions
diff --git a/configure.ac b/configure.ac
index c70b6ea..76f09b5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -109,7 +109,7 @@ AC_C_BIGENDIAN
dnl Check for Glib
PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.16, gobject-2.0 >= 2.16, gthread-2.0 >=
-2.4, gio-2.0 >= 2.28])
+2.4, gio-2.0 >= 2.26])
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
diff --git a/wocky/wocky-ll-connection-factory.c b/wocky/wocky-ll-connection-factory.c
index 87799ba..892a718 100644
--- a/wocky/wocky-ll-connection-factory.c
+++ b/wocky/wocky-ll-connection-factory.c
@@ -163,9 +163,8 @@ process_one_address (NewConnectionData *data)
if (g_cancellable_is_cancelled (data->cancellable))
{
- GError *error = g_error_new (G_IO_ERROR,
+ g_simple_async_result_set_error (data->simple, G_IO_ERROR,
G_IO_ERROR_CANCELLED, "Operation cancelled");
- g_simple_async_result_take_error (data->simple, error);
g_simple_async_result_complete (data->simple);
free_new_connection_data (data);
return;
@@ -176,10 +175,10 @@ process_one_address (NewConnectionData *data)
/* check we haven't gotten to the end of the list */
if (addr == NULL)
{
- GError *error = g_error_new (WOCKY_LL_CONNECTION_FACTORY_ERROR,
+ g_simple_async_result_set_error (data->simple,
+ WOCKY_LL_CONNECTION_FACTORY_ERROR,
WOCKY_LL_CONNECTION_FACTORY_ERROR_NO_CONTACT_ADDRESS_CAN_BE_CONNECTED_TO,
"Failed to connect to any of the contact's addresses");
- g_simple_async_result_take_error (data->simple, error);
g_simple_async_result_complete (data->simple);
free_new_connection_data (data);
return;
@@ -253,10 +252,10 @@ wocky_ll_connection_factory_make_connection_async (
if (data->addresses == NULL)
{
- GError *error = g_error_new (WOCKY_LL_CONNECTION_FACTORY_ERROR,
+ g_simple_async_result_set_error (data->simple,
+ WOCKY_LL_CONNECTION_FACTORY_ERROR,
WOCKY_LL_CONNECTION_FACTORY_ERROR_NO_CONTACT_ADDRESSES,
"No addresses available for contact");
- g_simple_async_result_take_error (data->simple, error);
g_simple_async_result_complete (data->simple);
free_new_connection_data (data);
return;
diff --git a/wocky/wocky-ll-connector.c b/wocky/wocky-ll-connector.c
index 569b3a2..76d4057 100644
--- a/wocky/wocky-ll-connector.c
+++ b/wocky/wocky-ll-connector.c
@@ -310,14 +310,12 @@ features_sent_cb (GObject *source_object,
if (!wocky_xmpp_connection_send_stanza_finish (connection, result, &error))
{
- GError *err = g_error_new (WOCKY_LL_CONNECTOR_ERROR,
+ DEBUG ("Failed to send stream features: %s", error->message);
+
+ g_simple_async_result_set_error (priv->simple, WOCKY_LL_CONNECTOR_ERROR,
WOCKY_LL_CONNECTOR_ERROR_FAILED_TO_SEND_STANZA,
"Failed to send stream features: %s", error->message);
g_clear_error (&error);
-
- DEBUG ("%s", err->message);
-
- g_simple_async_result_take_error (priv->simple, err);
}
g_simple_async_result_complete (priv->simple);
@@ -341,14 +339,13 @@ recv_open_cb (GObject *source_object,
if (!wocky_xmpp_connection_recv_open_finish (connection, result,
NULL, &from, NULL, NULL, NULL, &error))
{
- GError *err = g_error_new (WOCKY_LL_CONNECTOR_ERROR,
+ DEBUG ("Failed to receive stream open: %s", error->message);
+
+ g_simple_async_result_set_error (priv->simple, WOCKY_LL_CONNECTOR_ERROR,
WOCKY_LL_CONNECTOR_ERROR_FAILED_TO_RECEIVE_STANZA,
"Failed to receive stream open: %s", error->message);
- g_clear_error (&error);
-
- DEBUG ("%s", err->message);
- g_simple_async_result_take_error (priv->simple, err);
g_simple_async_result_complete (priv->simple);
+ g_clear_error (&error);
g_object_unref (self);
return;
}
@@ -390,15 +387,13 @@ send_open_cb (GObject *source_object,
if (!wocky_xmpp_connection_send_open_finish (connection, result, &error))
{
- GError *err = g_error_new (WOCKY_LL_CONNECTOR_ERROR,
+ DEBUG ("Failed to send stream open: %s", error->message);
+
+ g_simple_async_result_set_error (priv->simple, WOCKY_LL_CONNECTOR_ERROR,
WOCKY_LL_CONNECTOR_ERROR_FAILED_TO_SEND_STANZA,
"Failed to send stream open: %s", error->message);
- g_clear_error (&error);
-
- DEBUG ("%s", err->message);
-
- g_simple_async_result_take_error (priv->simple, err);
g_simple_async_result_complete (priv->simple);
+ g_clear_error (&error);
g_object_unref (self);
return;
}
diff --git a/wocky/wocky-meta-porter.c b/wocky/wocky-meta-porter.c
index e3a8d5f..d359b4e 100644
--- a/wocky/wocky-meta-porter.c
+++ b/wocky/wocky-meta-porter.c
@@ -886,7 +886,10 @@ meta_porter_send_cb (GObject *source_object,
GError *error = NULL;
if (!wocky_porter_send_finish (WOCKY_PORTER (source_object), result, &error))
- g_simple_async_result_take_error (simple, error);
+ {
+ g_simple_async_result_set_from_error (simple, error);
+ g_clear_error (&error);
+ }
g_simple_async_result_complete (simple);
g_object_unref (simple);
@@ -1257,11 +1260,9 @@ porter_close_cb (GObject *source_object,
if (data->failed)
{
- GError *err = g_error_new (WOCKY_META_PORTER_ERROR,
+ g_simple_async_result_set_error (data->simple, WOCKY_META_PORTER_ERROR,
WOCKY_META_PORTER_ERROR_FAILED_TO_CLOSE,
"Failed to close at least one porter");
-
- g_simple_async_result_take_error (data->simple, err);
}
g_simple_async_result_complete (data->simple);
@@ -1370,7 +1371,10 @@ meta_porter_send_iq_cb (GObject *source_object,
result, &error);
if (stanza == NULL)
- g_simple_async_result_take_error (simple, error);
+ {
+ g_simple_async_result_set_from_error (simple, error);
+ g_clear_error (&error);
+ }
else
g_simple_async_result_set_op_res_gpointer (simple, stanza, g_object_unref);
diff --git a/wocky/wocky-uninstalled.pc.in b/wocky/wocky-uninstalled.pc.in
index 001f6e2..fb286a9 100644
--- a/wocky/wocky-uninstalled.pc.in
+++ b/wocky/wocky-uninstalled.pc.in
@@ -7,6 +7,6 @@ Name: Wocky (uninstalled copy)
Description: XMPP library
Version: @VERSION@
Requires: pkg-config >= 0.21
-Requires.private: glib-2.0 >= 2.16, gobject-2.0 >= 2.16, gio-2.0 >= 2.28
+Requires.private: glib-2.0 >= 2.16, gobject-2.0 >= 2.16, gio-2.0 >= 2.26
Libs: ${abs_top_builddir}/wocky/libwocky.la
Cflags: -I${abs_top_srcdir} -I${abs_top_builddir} -I${abs_top_builddir}/wocky