summaryrefslogtreecommitdiff
path: root/examples/client
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2013-09-26 14:28:40 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2013-09-26 16:30:46 +0100
commitaa407653e274480ae63b21017869e07de3a1aa4e (patch)
tree457aa101d5ddb7e5d50bcee1b805478067460967 /examples/client
parente6ac4848a0e613087b024af9f4c21fec3ee509ef (diff)
Make more use of tp_value_array_unpack, tp_value_array_build
As well as being less code, they're not flagged as deprecated. This requires a bit of extra copying, because there's no tp_value_array_unpack_dup() or tp_value_array_build_take(), but it seems worth it. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69849 Reviewed-by: Xavier Claessens <xavier.claessens@collabora.co.uk>
Diffstat (limited to 'examples/client')
-rw-r--r--examples/client/extended-client.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/examples/client/extended-client.c b/examples/client/extended-client.c
index 55e3086e2..117223179 100644
--- a/examples/client/extended-client.c
+++ b/examples/client/extended-client.c
@@ -71,14 +71,15 @@ got_hats_cb (TpConnection *conn,
for (i = 0; i < hats->len; i++)
{
GValueArray *vals = g_ptr_array_index (hats, i);
+ guint handle;
+ const gchar *color;
+ guint style;
+ GHashTable *details;
+ tp_value_array_unpack (vals, 4,
+ &handle, &color, &style, &details);
g_message ("Contact #%u has hat style %u, color \"%s\", with %u "
- "properties",
- g_value_get_uint (g_value_array_get_nth (vals, 0)),
- g_value_get_uint (g_value_array_get_nth (vals, 2)),
- g_value_get_string (g_value_array_get_nth (vals, 1)),
- g_hash_table_size (g_value_get_boxed (g_value_array_get_nth (vals,
- 3))));
+ "properties", handle, style, color, g_hash_table_size (details));
}
tp_cli_connection_call_disconnect (conn, -1, disconnect_cb,