From d9a08300e0559a90ed9853665e0d92b783b6dbe4 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Mon, 4 Jun 2012 14:30:48 +0200 Subject: Examples: Stop using tp_connection_manager_protocol_* They are soon to be deprecated --- examples/client/inspect-cm.c | 43 ++++++++++++++++++------------------------- 1 file changed, 18 insertions(+), 25 deletions(-) (limited to 'examples') diff --git a/examples/client/inspect-cm.c b/examples/client/inspect-cm.c index 319a9da67..bddf74a57 100644 --- a/examples/client/inspect-cm.c +++ b/examples/client/inspect-cm.c @@ -46,8 +46,7 @@ ready (GObject *source, } else { - gchar **protocols; - guint i; + GList *protocols; g_assert (tp_proxy_is_prepared (cm, TP_CONNECTION_MANAGER_FEATURE_CORE)); @@ -60,39 +59,31 @@ ready (GObject *source, tp_connection_manager_get_info_source (cm) == TP_CM_INFO_SOURCE_LIVE ? "D-Bus" : ".manager file"); - protocols = tp_connection_manager_dup_protocol_names (cm); - - for (i = 0; protocols != NULL && protocols[i] != NULL; i++) + protocols = tp_connection_manager_dup_protocols (cm); + while (protocols) { - const TpConnectionManagerProtocol *protocol; - gchar **params; - guint j; - - g_message ("Protocol: %s", protocols[i]); - protocol = tp_connection_manager_get_protocol (cm, protocols[i]); - g_assert (protocol != NULL); + TpProtocol *protocol = protocols->data; + GList *params; + g_message ("Protocol: %s", tp_protocol_get_name (protocol)); g_message ("\tCan register accounts via Telepathy: %s", - tp_connection_manager_protocol_can_register (protocol) ? - "yes" : "no"); - - params = tp_connection_manager_protocol_dup_param_names (protocol); + tp_protocol_can_register (protocol) ? "yes" : "no"); - for (j = 0; params != NULL && params[j] != NULL; j++) + params = tp_protocol_dup_params (protocol); + while (params) { - const TpConnectionManagerParam *param; + TpConnectionManagerParam *param = params->data; GValue value = { 0 }; - g_message ("\tParameter: %s", params[j]); - param = tp_connection_manager_protocol_get_param (protocol, - params[j]); + g_message ("\tParameter: %s", + tp_connection_manager_param_get_name (param)); g_message ("\t\tD-Bus signature: %s", tp_connection_manager_param_get_dbus_signature (param)); g_message ("\t\tIs required: %s", tp_connection_manager_param_is_required (param) ? "yes" : "no"); - if (tp_connection_manager_protocol_can_register (protocol)) + if (tp_protocol_can_register (protocol)) { g_message ("\t\tIs required for registration: %s", tp_connection_manager_param_is_required_for_registration ( @@ -118,12 +109,14 @@ ready (GObject *source, { g_message ("\t\tNo default value"); } + + tp_connection_manager_param_free (param); + params = g_list_delete_link (params, params); } - g_strfreev (params); + g_object_unref (protocol); + protocols = g_list_delete_link (protocols, protocols); } - - g_strfreev (protocols); } g_main_loop_quit (mainloop); -- cgit v1.2.1