From ad13c46c04f0d0a384f130115157364d9897511f Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 9 Feb 2012 15:58:32 +0000 Subject: [PATCH 7/7] inspect-cm example: stop using call_when_ready --- examples/client/inspect-cm.c | 20 ++++++++++++-------- 1 files changed, 12 insertions(+), 8 deletions(-) diff --git a/examples/client/inspect-cm.c b/examples/client/inspect-cm.c index 7b54719..319a9da 100644 --- a/examples/client/inspect-cm.c +++ b/examples/client/inspect-cm.c @@ -28,25 +28,29 @@ #include static void -ready (TpConnectionManager *cm, - const GError *error, - gpointer user_data, - GObject *weak_object G_GNUC_UNUSED) +ready (GObject *source, + GAsyncResult *result, + gpointer user_data) { + TpConnectionManager *cm = TP_CONNECTION_MANAGER (source); GMainLoop *mainloop = user_data; + GError *error = NULL; - if (error != NULL) + if (!tp_proxy_prepare_finish (cm, result, &error)) { - g_assert (!tp_connection_manager_is_ready (cm)); + g_assert (!tp_proxy_is_prepared (cm, + TP_CONNECTION_MANAGER_FEATURE_CORE)); g_warning ("Error getting CM info: %s", error->message); + g_error_free (error); } else { gchar **protocols; guint i; - g_assert (tp_connection_manager_is_ready (cm)); + g_assert (tp_proxy_is_prepared (cm, + TP_CONNECTION_MANAGER_FEATURE_CORE)); g_message ("Connection manager name: %s", tp_connection_manager_get_name (cm)); @@ -165,7 +169,7 @@ main (int argc, goto out; } - tp_connection_manager_call_when_ready (cm, ready, mainloop, NULL, NULL); + tp_proxy_prepare_async (cm, NULL, ready, mainloop); g_main_loop_run (mainloop); ret = 0; -- 1.7.9.1