diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-09-26 14:28:40 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-09-26 16:30:46 +0100 |
commit | aa407653e274480ae63b21017869e07de3a1aa4e (patch) | |
tree | 457aa101d5ddb7e5d50bcee1b805478067460967 /telepathy-glib/capabilities.c | |
parent | e6ac4848a0e613087b024af9f4c21fec3ee509ef (diff) | |
download | telepathy-glib-aa407653e274480ae63b21017869e07de3a1aa4e.tar.gz |
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 'telepathy-glib/capabilities.c')
-rw-r--r-- | telepathy-glib/capabilities.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/telepathy-glib/capabilities.c b/telepathy-glib/capabilities.c index 4ddf368f3..d4557b44a 100644 --- a/telepathy-glib/capabilities.c +++ b/telepathy-glib/capabilities.c @@ -322,11 +322,14 @@ supports_simple_channel (TpCapabilities *self, { GValueArray *arr = g_ptr_array_index (self->priv->classes, i); GHashTable *fixed; + const gchar * const *allowed; const gchar *chan_type; TpHandleType handle_type; gboolean valid; - fixed = g_value_get_boxed (g_value_array_get_nth (arr, 0)); + tp_value_array_unpack (arr, 2, + &fixed, + &allowed); if (g_hash_table_size (fixed) != 2) continue; @@ -439,8 +442,9 @@ tp_capabilities_supports_sms (TpCapabilities *self) gboolean valid; guint nb_fixed_props; - fixed = g_value_get_boxed (g_value_array_get_nth (arr, 0)); - allowed = g_value_get_boxed (g_value_array_get_nth (arr, 1)); + tp_value_array_unpack (arr, 2, + &fixed, + &allowed); handle_type = tp_asv_get_uint32 (fixed, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, &valid); @@ -809,12 +813,15 @@ tp_capabilities_supports_tubes_common (TpCapabilities *self, { GValueArray *arr = g_ptr_array_index (self->priv->classes, i); GHashTable *fixed; + const gchar * const *allowed; const gchar *chan_type; TpHandleType handle_type; gboolean valid; guint nb_fixed_props = 2; - fixed = g_value_get_boxed (g_value_array_get_nth (arr, 0)); + tp_value_array_unpack (arr, 2, + &fixed, + &allowed); chan_type = tp_asv_get_string (fixed, TP_PROP_CHANNEL_CHANNEL_TYPE); if (tp_strdiff (chan_type, expected_channel_type)) |