diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2014-04-06 22:38:03 -0400 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-04-17 14:22:29 +0100 |
commit | 5cb97d3e0c41c3afe12823f18112325d3dc83e67 (patch) | |
tree | 19376c2818590ad416a42d8fca8ea6babdefa892 /tests/lib/contacts-conn.c | |
parent | fc04741fc3e2952b95628e72663e358fbcd33ed5 (diff) |
TpBaseConnection: Change fill_contact_attributes() to take a GVariantDict
Diffstat (limited to 'tests/lib/contacts-conn.c')
-rw-r--r-- | tests/lib/contacts-conn.c | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/tests/lib/contacts-conn.c b/tests/lib/contacts-conn.c index 092ae975d..c59928fad 100644 --- a/tests/lib/contacts-conn.c +++ b/tests/lib/contacts-conn.c @@ -190,11 +190,26 @@ finalize (GObject *object) G_OBJECT_CLASS (tp_tests_contacts_connection_parent_class)->finalize (object); } +static GVariant * +_tp_g_variant_new_boxed (GType gtype, + gpointer boxed) +{ + GValue value = G_VALUE_INIT; + GVariant *variant; + + g_value_init (&value, gtype); + g_value_set_boxed (&value, boxed); + variant = dbus_g_value_build_g_variant (&value); + g_value_unset (&value); + + return variant; +} + static void tp_tests_contacts_connection_fill_contact_attributes (TpBaseConnection *base, const gchar *dbus_interface, TpHandle contact, - TpContactAttributeMap *attributes) + GVariantDict *attributes) { TpTestsContactsConnection *self = TP_TESTS_CONTACTS_CONNECTION (base); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (base, @@ -211,9 +226,8 @@ tp_tests_contacts_connection_fill_contact_attributes (TpBaseConnection *base, alias = tp_handle_inspect (contact_repo, contact); } - tp_contact_attribute_map_take_sliced_gvalue (attributes, contact, - TP_IFACE_CONNECTION_INTERFACE_ALIASING1 "/alias", - tp_g_value_slice_new_string (alias)); + g_variant_dict_insert (attributes, + TP_IFACE_CONNECTION_INTERFACE_ALIASING1 "/alias", "s", alias); return; } @@ -226,9 +240,8 @@ tp_tests_contacts_connection_fill_contact_attributes (TpBaseConnection *base, if (a != NULL && a->token != NULL) { - tp_contact_attribute_map_take_sliced_gvalue (attributes, contact, - TP_IFACE_CONNECTION_INTERFACE_AVATARS1 "/token", - tp_g_value_slice_new_string (a->token)); + g_variant_dict_insert (attributes, + TP_IFACE_CONNECTION_INTERFACE_AVATARS1 "/token", "s", a->token); } return; @@ -242,9 +255,9 @@ tp_tests_contacts_connection_fill_contact_attributes (TpBaseConnection *base, if (location != NULL) { - tp_contact_attribute_map_take_sliced_gvalue (attributes, contact, + g_variant_dict_insert_value (attributes, TP_IFACE_CONNECTION_INTERFACE_LOCATION1 "/location", - tp_g_value_slice_new_boxed (TP_HASH_TYPE_LOCATION, location)); + _tp_g_variant_new_boxed (TP_HASH_TYPE_LOCATION, location)); } return; @@ -258,10 +271,10 @@ tp_tests_contacts_connection_fill_contact_attributes (TpBaseConnection *base, if (caps != NULL) { - tp_contact_attribute_map_take_sliced_gvalue (attributes, contact, + g_variant_dict_insert_value (attributes, TP_IFACE_CONNECTION_INTERFACE_CONTACT_CAPABILITIES1 "/capabilities", - tp_g_value_slice_new_boxed ( - TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, caps)); + _tp_g_variant_new_boxed ( + TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, caps)); } return; @@ -275,9 +288,9 @@ tp_tests_contacts_connection_fill_contact_attributes (TpBaseConnection *base, if (info != NULL) { - tp_contact_attribute_map_take_sliced_gvalue (attributes, contact, + g_variant_dict_insert_value (attributes, TP_IFACE_CONNECTION_INTERFACE_CONTACT_INFO1 "/info", - tp_g_value_slice_new_boxed (TP_ARRAY_TYPE_CONTACT_INFO_FIELD_LIST, + _tp_g_variant_new_boxed (TP_ARRAY_TYPE_CONTACT_INFO_FIELD_LIST, info)); } |