[telepathy-doc/master] Unpack the channels array
Davyd Madeley
davyd at madeley.id.au
Thu Jul 30 22:56:53 PDT 2009
---
docs/examples/glib_mc5_observer/example-observer.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/docs/examples/glib_mc5_observer/example-observer.c b/docs/examples/glib_mc5_observer/example-observer.c
index 1f5ae4f..e9d4518 100644
--- a/docs/examples/glib_mc5_observer/example-observer.c
+++ b/docs/examples/glib_mc5_observer/example-observer.c
@@ -49,6 +49,18 @@ example_observer_observe_channels (TpSvcClientObserver *self,
g_print (" connection = %s\n", connection);
g_print (" dispatchop = %s\n", dispatch_op);
+ /* channels is of type a(oa{sv}) */
+ int i;
+ for (i = 0; i < channels->len; i++)
+ {
+ GValueArray *channel = g_ptr_array_index (channels, i);
+
+ char *path = g_value_get_boxed (g_value_array_get_nth (channel, 0));
+ GHashTable *map = g_value_get_boxed (g_value_array_get_nth (channel, 1));
+
+ g_print (" channel = %s\n", path);
+ }
+
tp_svc_client_observer_return_from_observe_channels (context);
}
--
1.5.6.5
More information about the telepathy-commits
mailing list