summaryrefslogtreecommitdiff
path: root/telepathy-glib/protocol.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-02-04 12:51:58 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-02-04 12:52:07 +0000
commitbdba6fdf7804c050197db70d5840ae0f96cfe4be (patch)
treeeaa118be77ad165bd58ce97a8bc53c03fd1629eb /telepathy-glib/protocol.c
parent64e9a2cfc53c6786e0a1005f244fa7a8e635d8c7 (diff)
downloadtelepathy-glib-bdba6fdf7804c050197db70d5840ae0f96cfe4be.tar.gz
tp_connection_manager_param_dup_variant_type: add
In order for this to work, TpProtocol now ignores parameters whose D-Bus signatures are not a syntactically valid single complete type. This is helpful for Mission Control to be able to migrate parameters from untyped to typed storage - it stores parameters in terms of GVariant. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71093 Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> [added (transfer full) as requested in review -smcv]
Diffstat (limited to 'telepathy-glib/protocol.c')
-rw-r--r--telepathy-glib/protocol.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/telepathy-glib/protocol.c b/telepathy-glib/protocol.c
index 867db25f1..ee9b7e282 100644
--- a/telepathy-glib/protocol.c
+++ b/telepathy-glib/protocol.c
@@ -215,6 +215,15 @@ tp_protocol_params_from_param_specs (const GPtrArray *parameters,
continue;
}
+ if (!g_variant_type_string_is_valid (param->dbus_signature))
+ {
+ DEBUG ("Parameter #%d for %s has type '%s' which is not a "
+ "single complete type, ignoring", i, protocol,
+ param->dbus_signature);
+ g_array_set_size (output, output->len - 1);
+ continue;
+ }
+
g_value_init (&param->default_value,
G_VALUE_TYPE (tmp));
g_value_copy (tmp, &param->default_value);