diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-05-10 15:20:02 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-05-14 15:01:48 +0100 |
commit | 42f20c1472f0073b320b860e1f868817cb6c3bb5 (patch) | |
tree | 3d0578d2c32bc992a356444b7253fe70348c913b | |
parent | 96b49d683e449841ae4dc0a09aae6223db1a2a90 (diff) |
_mcd_client_proxy_add_cap_tokens: switch from "add" to "set" semantics
In both the cases where it's called (when we get a reply to GetAll,
and when we've parsed a .client file), we actually want to take the
new set, not union it with an existing set.
Also, this will be easier to deal with when we stop (ab)using handles
for this.
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49753
-rw-r--r-- | src/mcd-client.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mcd-client.c b/src/mcd-client.c index 90a08ba6..1e1ec511 100644 --- a/src/mcd-client.c +++ b/src/mcd-client.c @@ -330,8 +330,8 @@ parse_client_filter (GKeyFile *file, const gchar *group) return filter; } -static void _mcd_client_proxy_add_cap_tokens (McdClientProxy *self, - const gchar * const *cap_tokens); +static void _mcd_client_proxy_set_cap_tokens (McdClientProxy *self, + GStrv cap_tokens); static void _mcd_client_proxy_add_interfaces (McdClientProxy *self, const gchar * const *interfaces); @@ -422,8 +422,7 @@ parse_client_file (McdClientProxy *client, TP_IFACE_CLIENT_HANDLER ".Capabilities", NULL, NULL); - _mcd_client_proxy_add_cap_tokens (client, - (const gchar * const *) cap_tokens); + _mcd_client_proxy_set_cap_tokens (client, cap_tokens); g_strfreev (cap_tokens); } @@ -522,11 +521,13 @@ _mcd_client_proxy_set_filters (McdClientProxy *client, /* This is NULL-safe for the last argument, for ease of use with * tp_asv_get_boxed */ static void -_mcd_client_proxy_add_cap_tokens (McdClientProxy *self, - const gchar * const *cap_tokens) +_mcd_client_proxy_set_cap_tokens (McdClientProxy *self, + GStrv cap_tokens) { guint i; + tp_handle_set_clear (self->priv->capability_tokens); + if (cap_tokens == NULL) return; @@ -691,7 +692,7 @@ _mcd_client_proxy_handler_get_all_cb (TpProxy *proxy, * any capabilities */ if (self->priv->unique_name[0] != '\0' || self->priv->activatable) { - _mcd_client_proxy_add_cap_tokens (self, + _mcd_client_proxy_set_cap_tokens (self, tp_asv_get_boxed (properties, "Capabilities", G_TYPE_STRV)); g_signal_emit (self, signals[S_HANDLER_CAPABILITIES_CHANGED], 0); } |