summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.co.uk>2012-06-04 14:30:28 +0200
committerXavier Claessens <xavier.claessens@collabora.co.uk>2012-06-04 15:15:53 +0200
commit6d179e6e6ead222f7d8c1b0f3e16a30571014303 (patch)
tree8cb8845340dfdf94ac3868dc8127a7f7047ee197 /examples
parentc31f0ea8cd559442fab46d1c82077dde457633df (diff)
downloadtelepathy-glib-6d179e6e6ead222f7d8c1b0f3e16a30571014303.tar.gz
Examples: Stop using tp_list_connection_managers()
It is soon to be deprecated
Diffstat (limited to 'examples')
-rw-r--r--examples/client/list-managers.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/examples/client/list-managers.c b/examples/client/list-managers.c
index 5ba49a1cb..bffd19b23 100644
--- a/examples/client/list-managers.c
+++ b/examples/client/list-managers.c
@@ -19,36 +19,33 @@ typedef struct {
} ExampleData;
static void
-got_connection_managers (TpConnectionManager * const *cms,
- gsize n_cms,
- const GError *error,
- gpointer user_data,
- GObject *unused)
+got_connection_managers (GObject *source,
+ GAsyncResult *result,
+ gpointer user_data)
{
ExampleData *data = user_data;
+ GList *cms;
+ GError *error = NULL;
+ cms = tp_list_connection_managers_finish (result, &error);
if (error != NULL)
{
g_warning ("%s", error->message);
+ g_clear_error (&error);
data->exit_code = 1;
}
else
{
- TpConnectionManager * const *iter = cms;
-
- g_message ("Found %" G_GSIZE_FORMAT " connection managers:", n_cms);
+ g_message ("Found %u connection managers:", g_list_length (cms));
- for (iter = cms; *iter != NULL; iter++)
+ while (cms != NULL)
{
- gchar *name;
-
- g_object_get (*iter,
- "connection-manager", &name,
- NULL);
+ TpConnectionManager *cm = cms->data;
- g_message ("- %s", name);
+ g_message ("- %s", tp_connection_manager_get_name (cm));
- g_free (name);
+ g_object_unref (cm);
+ cms = g_list_delete_link (cms, cms);
}
}
@@ -76,8 +73,8 @@ main (int argc,
goto out;
}
- tp_list_connection_managers (bus_daemon, got_connection_managers, &data,
- NULL, NULL);
+ tp_list_connection_managers_async (bus_daemon,
+ got_connection_managers, &data);
g_main_loop_run (data.mainloop);