From 76cb5958437c94f9b2a2c7d6e46bbaddc5c4cfe6 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 17 Apr 2014 15:14:23 -0400 Subject: [PATCH 2/5] TpBaseChannel:fill_immutable_properties: Take a GVariantDict --- .../telepathy-glib/telepathy-glib-sections.txt | 4 +- examples/cm/echo-message-parts/chan.c | 4 +- telepathy-glib/base-call-channel.c | 4 +- telepathy-glib/base-channel.c | 54 ++++++++----- telepathy-glib/base-channel.h | 3 +- telepathy-glib/base-connection-manager.c | 13 ++-- telepathy-glib/base-connection.c | 28 ++----- telepathy-glib/base-password-channel.c | 6 +- telepathy-glib/base-protocol.c | 53 +++++-------- telepathy-glib/base-protocol.h | 2 +- telepathy-glib/dbus-properties-mixin.c | 89 +++++----------------- telepathy-glib/dbus-properties-mixin.h | 9 +-- telepathy-glib/versions/dbus-1.0.abi | 3 +- tests/lib/dbus-tube-chan.c | 6 +- tests/lib/file-transfer-chan.c | 6 +- tests/lib/room-list-chan.c | 4 +- tests/lib/stream-tube-chan.c | 6 +- 17 files changed, 112 insertions(+), 182 deletions(-) diff --git a/docs/reference/telepathy-glib/telepathy-glib-sections.txt b/docs/reference/telepathy-glib/telepathy-glib-sections.txt index 42a6967..7fef3a9 100644 --- a/docs/reference/telepathy-glib/telepathy-glib-sections.txt +++ b/docs/reference/telepathy-glib/telepathy-glib-sections.txt @@ -163,6 +163,7 @@ tp_base_channel_reopened tp_base_channel_disappear tp_base_channel_reopened_with_requested tp_base_channel_get_object_path +tp_base_channel_get_channel_properties tp_base_channel_get_connection tp_base_channel_get_self_handle tp_base_channel_get_target_handle @@ -1921,8 +1922,7 @@ tp_dbus_properties_mixin_dup_all_vardict tp_dbus_properties_mixin_dup_all tp_dbus_properties_mixin_set_variant tp_dbus_properties_mixin_set -tp_dbus_properties_mixin_fill_properties_hash -tp_dbus_properties_mixin_make_properties_hash +tp_dbus_properties_mixin_fill_properties tp_dbus_properties_mixin_emit_properties_changed tp_dbus_properties_mixin_emit_properties_changed_varargs diff --git a/examples/cm/echo-message-parts/chan.c b/examples/cm/echo-message-parts/chan.c index a077890..6c3d8bb 100644 --- a/examples/cm/echo-message-parts/chan.c +++ b/examples/cm/echo-message-parts/chan.c @@ -267,14 +267,14 @@ example_echo_2_channel_close (TpBaseChannel *self) static void example_echo_2_channel_fill_immutable_properties (TpBaseChannel *chan, - GHashTable *properties) + GVariantDict *properties) { TpBaseChannelClass *klass = TP_BASE_CHANNEL_CLASS ( example_echo_2_channel_parent_class); klass->fill_immutable_properties (chan, properties); - tp_dbus_properties_mixin_fill_properties_hash ( + tp_dbus_properties_mixin_fill_properties ( G_OBJECT (chan), properties, TP_IFACE_CHANNEL_TYPE_TEXT, "MessagePartSupportFlags", TP_IFACE_CHANNEL_TYPE_TEXT, "DeliveryReportingSupport", diff --git a/telepathy-glib/base-call-channel.c b/telepathy-glib/base-call-channel.c index a13a900..f4e8503 100644 --- a/telepathy-glib/base-call-channel.c +++ b/telepathy-glib/base-call-channel.c @@ -426,12 +426,12 @@ tp_base_call_channel_set_property (GObject *object, static void tp_base_call_channel_fill_immutable_properties ( TpBaseChannel *chan, - GHashTable *properties) + GVariantDict *properties) { TP_BASE_CHANNEL_CLASS (tp_base_call_channel_parent_class) ->fill_immutable_properties (chan, properties); - tp_dbus_properties_mixin_fill_properties_hash ( + tp_dbus_properties_mixin_fill_properties ( G_OBJECT (chan), properties, TP_IFACE_CHANNEL_TYPE_CALL1, "InitialTransport", TP_IFACE_CHANNEL_TYPE_CALL1, "InitialAudio", diff --git a/telepathy-glib/base-channel.c b/telepathy-glib/base-channel.c index b5ff0c6..2700dd9 100644 --- a/telepathy-glib/base-channel.c +++ b/telepathy-glib/base-channel.c @@ -130,9 +130,9 @@ * by tp_base_channel_close() and by the implementation of the Closed D-Bus * method. * @fill_immutable_properties: A virtual function called to add custom - * properties to the DBus properties hash. Implementations must chain up to the + * properties to the DBus properties hash. Implementations must chain up to the * parent class implementation and call - * tp_dbus_properties_mixin_fill_properties_hash() on the supplied hash table + * tp_dbus_properties_mixin_fill_properties() on the supplied hash table * @get_object_path_suffix: Returns a string that will be appended to the * Connection objects's object path to get the Channel's object path. This * function will only be called as a fallback if the @@ -221,7 +221,7 @@ * @chan: a channel * @properties: a dictionary of @chan's immutable properties, which the * implementation may add to using - * tp_dbus_properties_mixin_fill_properties_hash() + * tp_dbus_properties_mixin_fill_properties() * * Signature of an implementation of the * #TpBaseChannelClass.fill_immutable_properties @@ -232,13 +232,13 @@ * static void * my_search_channel_fill_properties ( * TpBaseChannel *chan, - * GHashTable *properties) + * GVariantDict *properties) * { * TpBaseChannelClass *klass = TP_BASE_CHANNEL_CLASS (my_search_channel_parent_class); * * klass->fill_immutable_properties (chan, properties); * - * tp_dbus_properties_mixin_fill_properties_hash ( + * tp_dbus_properties_mixin_fill_properties ( * G_OBJECT (chan), properties, * TP_IFACE_CHANNEL_TYPE_CONTACT_SEARCH, "Limit", * TP_IFACE_CHANNEL_TYPE_CONTACT_SEARCH, "AvailableSearchKeys", @@ -568,6 +568,30 @@ tp_base_channel_get_object_path (TpBaseChannel *chan) } /** + * tp_base_channel_get_channel_properties: + * @chan: a channel + * + * + * + * Returns: (transfer none): a floating "a{sv}" #GVariant as + * #TpBaseChannel:channel-properties + * + * Since: 0.UNRELEASED + */ +GVariant * +tp_base_channel_get_channel_properties (TpBaseChannel *chan) +{ + TpBaseChannelClass *klass = TP_BASE_CHANNEL_GET_CLASS (chan); + GVariantDict properties; + + g_return_val_if_fail (TP_IS_BASE_CHANNEL (chan), NULL); + + g_variant_dict_init (&properties, NULL); + klass->fill_immutable_properties (chan, &properties); + + return g_variant_dict_end (&properties); +} +/** * tp_base_channel_get_connection: * @chan: a channel * @@ -738,12 +762,13 @@ tp_base_channel_is_respawning (TpBaseChannel *chan) * tp_base_channel_fill_basic_immutable_properties: * * Specifies the immutable properties supported for this Channel object, by - * using tp_dbus_properties_mixin_fill_properties_hash(). + * using tp_dbus_properties_mixin_fill_properties(). */ static void -tp_base_channel_fill_basic_immutable_properties (TpBaseChannel *chan, GHashTable *properties) +tp_base_channel_fill_basic_immutable_properties (TpBaseChannel *chan, + GVariantDict *properties) { - tp_dbus_properties_mixin_fill_properties_hash (G_OBJECT (chan), + tp_dbus_properties_mixin_fill_properties (G_OBJECT (chan), properties, TP_IFACE_CHANNEL, "ChannelType", TP_IFACE_CHANNEL, "TargetEntityType", @@ -884,17 +909,8 @@ tp_base_channel_get_property (GObject *object, g_value_set_boolean (value, chan->priv->destroyed); break; case PROP_CHANNEL_PROPERTIES: - { - /* create an empty properties hash for subclasses to fill */ - GHashTable *properties = - tp_dbus_properties_mixin_make_properties_hash (G_OBJECT (chan), NULL, NULL, NULL); - - if (klass->fill_immutable_properties) - klass->fill_immutable_properties (chan, properties); - - g_value_set_variant (value, tp_asv_to_vardict (properties)); - g_hash_table_unref (properties); - } + g_value_set_variant (value, + tp_base_channel_get_channel_properties (chan)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); diff --git a/telepathy-glib/base-channel.h b/telepathy-glib/base-channel.h index e70333b..152385e 100644 --- a/telepathy-glib/base-channel.h +++ b/telepathy-glib/base-channel.h @@ -43,7 +43,7 @@ typedef struct _TpBaseChannelPrivate TpBaseChannelPrivate; typedef void (*TpBaseChannelCloseFunc) (TpBaseChannel *chan); typedef void (*TpBaseChannelFillPropertiesFunc) (TpBaseChannel *chan, - GHashTable *properties); + GVariantDict *properties); typedef gchar *(*TpBaseChannelGetPathFunc) (TpBaseChannel *chan); typedef GPtrArray *(*TpBaseChannelGetInterfacesFunc) (TpBaseChannel *chan); typedef void (*TpBaseChannelFunc) (TpBaseChannel *channel, @@ -86,6 +86,7 @@ void tp_base_channel_reopened_with_requested (TpBaseChannel *chan, gboolean requested, TpHandle initiator); const gchar *tp_base_channel_get_object_path (TpBaseChannel *chan); +GVariant *tp_base_channel_get_channel_properties (TpBaseChannel *chan); TpBaseConnection *tp_base_channel_get_connection (TpBaseChannel *chan); _TP_AVAILABLE_IN_0_18 TpHandle tp_base_channel_get_self_handle (TpBaseChannel *chan); diff --git a/telepathy-glib/base-connection-manager.c b/telepathy-glib/base-connection-manager.c index 51d845a..a1a23eb 100644 --- a/telepathy-glib/base-connection-manager.c +++ b/telepathy-glib/base-connection-manager.c @@ -39,6 +39,7 @@ #include +#include #include #include #include @@ -291,13 +292,15 @@ tp_base_connection_manager_get_property (GObject *object, while (g_hash_table_iter_next (&iter, &name, &protocol)) { - GHashTable *props; + GVariant *props; - g_object_get (protocol, - "immutable-properties", &props, - NULL); + props = tp_base_protocol_get_immutable_properties (protocol); + g_variant_ref_sink (props); - g_hash_table_insert (map, g_strdup (name), props); + g_hash_table_insert (map, g_strdup (name), + tp_asv_from_vardict (props)); + + g_variant_unref (props); } g_value_take_boxed (value, map); diff --git a/telepathy-glib/base-connection.c b/telepathy-glib/base-connection.c index ad78d8c..243b796 100644 --- a/telepathy-glib/base-connection.c +++ b/telepathy-glib/base-connection.c @@ -603,26 +603,17 @@ manager_new_channel_cb (TpChannelManager *manager, GSList *requests, TpBaseConnection *self) { - gchar *path; - GVariant *variant; - g_assert (TP_IS_CHANNEL_MANAGER (manager)); g_assert (TP_IS_BASE_CONNECTION (self)); /* satisfy the RequestChannel/CreateChannel/EnsureChannel calls */ manager_new_channel (self, channel, requests); - g_object_get (channel, - "object-path", &path, - "channel-properties", &variant, - NULL); - update_channels_property (self); _tp_gdbus_connection_interface_requests_emit_new_channel ( - self->priv->requests_skeleton, path, variant); - - g_free (path); - g_variant_unref (variant); + self->priv->requests_skeleton, + tp_base_channel_get_object_path (channel), + tp_base_channel_get_channel_properties (channel)); } @@ -869,17 +860,10 @@ manager_get_channel_details_foreach (TpBaseChannel *chan, gpointer user_data) { GVariantBuilder *builder = user_data; - GVariant *properties; - gchar *object_path; - g_object_get (chan, - "object-path", &object_path, - "channel-properties", &properties, - NULL); - - g_variant_builder_add (builder, "(o@a{sv})", object_path, properties); - g_variant_unref (properties); - g_free (object_path); + g_variant_builder_add (builder, "(o@a{sv})", + tp_base_channel_get_object_path (chan), + tp_base_channel_get_channel_properties (chan)); } static void diff --git a/telepathy-glib/base-password-channel.c b/telepathy-glib/base-password-channel.c index e1bc5c9..39c7222 100644 --- a/telepathy-glib/base-password-channel.c +++ b/telepathy-glib/base-password-channel.c @@ -281,7 +281,7 @@ tp_base_password_channel_get_property (GObject *object, static void tp_base_password_channel_finalize (GObject *object); static void tp_base_password_channel_close (TpBaseChannel *base); static void tp_base_password_channel_fill_immutable_properties (TpBaseChannel *chan, - GHashTable *properties); + GVariantDict *properties); static void tp_base_password_channel_class_init (TpBasePasswordChannelClass *tp_base_password_channel_class) @@ -434,14 +434,14 @@ tp_base_password_channel_close (TpBaseChannel *base) static void tp_base_password_channel_fill_immutable_properties (TpBaseChannel *chan, - GHashTable *properties) + GVariantDict *properties) { TpBaseChannelClass *klass = TP_BASE_CHANNEL_CLASS ( tp_base_password_channel_parent_class); klass->fill_immutable_properties (chan, properties); - tp_dbus_properties_mixin_fill_properties_hash ( + tp_dbus_properties_mixin_fill_properties ( G_OBJECT (chan), properties, TP_IFACE_CHANNEL_TYPE_SERVER_AUTHENTICATION1, "AuthenticationMethod", TP_IFACE_CHANNEL_INTERFACE_SASL_AUTHENTICATION1, "AvailableMechanisms", diff --git a/telepathy-glib/base-protocol.c b/telepathy-glib/base-protocol.c index b6071b3..8faaf22 100644 --- a/telepathy-glib/base-protocol.c +++ b/telepathy-glib/base-protocol.c @@ -702,43 +702,30 @@ tp_base_protocol_get_name (TpBaseProtocol *self) * tp_base_protocol_get_immutable_properties: * @self: a Protocol * - * Return a basic set of immutable properties for this Protocol object, - * by using tp_dbus_properties_mixin_make_properties_hash(). - * - * Additional keys and values can be inserted into the returned hash table; - * if this is done, the inserted keys and values will be freed when the - * hash table is destroyed. The keys must be allocated with g_strdup() or - * equivalent, and the values must be slice-allocated (for instance with - * tp_g_value_slice_new_string() or a similar function). - * - * Note that in particular, tp_asv_set_string() and similar functions should - * not be used with this hash table. - * - * Returns: (transfer container): a hash table mapping (gchar *) fully-qualified - * property names to GValues, which must be freed by the caller (at which point - * its contents will also be freed). + * Return the set of immutable properties for this Protocol object. * + * Returns: (transfer none): a floating "a{sv}" #GVariant * Since: 0.11.11 */ - -GHashTable * +GVariant * tp_base_protocol_get_immutable_properties (TpBaseProtocol *self) { TpBaseProtocolClass *cls; - GHashTable *table; + GVariantDict dict; g_return_val_if_fail (TP_IS_BASE_PROTOCOL (self), NULL); cls = TP_BASE_PROTOCOL_GET_CLASS (self); - table = tp_dbus_properties_mixin_make_properties_hash ((GObject *) self, + g_variant_dict_init (&dict, NULL); + tp_dbus_properties_mixin_fill_properties ((GObject *) self, &dict, TP_IFACE_PROTOCOL, "Parameters", NULL); if (cls->is_stub) - return table; + return g_variant_dict_end (&dict); - tp_dbus_properties_mixin_fill_properties_hash ((GObject *) self, table, + tp_dbus_properties_mixin_fill_properties ((GObject *) self, &dict, TP_IFACE_PROTOCOL, "Interfaces", TP_IFACE_PROTOCOL, "ConnectionInterfaces", TP_IFACE_PROTOCOL, "RequestableChannelClasses", @@ -750,7 +737,7 @@ tp_base_protocol_get_immutable_properties (TpBaseProtocol *self) if (cls->get_avatar_details != NULL) { - tp_dbus_properties_mixin_fill_properties_hash ((GObject *) self, table, + tp_dbus_properties_mixin_fill_properties ((GObject *) self, &dict, TP_IFACE_PROTOCOL_INTERFACE_AVATARS1, "SupportedAvatarMIMETypes", TP_IFACE_PROTOCOL_INTERFACE_AVATARS1, "MinimumAvatarHeight", TP_IFACE_PROTOCOL_INTERFACE_AVATARS1, "MinimumAvatarWidth", @@ -763,17 +750,17 @@ tp_base_protocol_get_immutable_properties (TpBaseProtocol *self) } if (TP_IS_PROTOCOL_ADDRESSING (self)) - tp_dbus_properties_mixin_fill_properties_hash ((GObject *) self, table, + tp_dbus_properties_mixin_fill_properties ((GObject *) self, &dict, TP_IFACE_PROTOCOL_INTERFACE_ADDRESSING1, "AddressableVCardFields", TP_IFACE_PROTOCOL_INTERFACE_ADDRESSING1, "AddressableURISchemes", NULL); if (cls->get_statuses != NULL) - tp_dbus_properties_mixin_fill_properties_hash ((GObject *) self, table, + tp_dbus_properties_mixin_fill_properties ((GObject *) self, &dict, TP_IFACE_PROTOCOL_INTERFACE_PRESENCE1, "Statuses", NULL); - return table; + return g_variant_dict_end (&dict); } static void @@ -791,7 +778,7 @@ tp_base_protocol_get_property (GObject *object, break; case PROP_IMMUTABLE_PROPERTIES: - g_value_take_boxed (value, + g_value_set_variant (value, tp_base_protocol_get_immutable_properties (self)); break; @@ -1155,21 +1142,15 @@ tp_base_protocol_class_init (TpBaseProtocolClass *klass) * properties mentioned here should also be exposed through the D-Bus * properties interface. * - * The #TpBaseProtocol base class implements this property to be correct - * for the basic set of properties. It can be reimplemented by - * subclasses to have more immutable properties; if so, the subclass - * should use tp_base_protocol_get_immutable_properties(), - * then augment the result using - * tp_dbus_properties_mixin_fill_properties_hash(). - * * Since: 0.11.11 */ g_object_class_install_property (object_class, PROP_IMMUTABLE_PROPERTIES, - g_param_spec_boxed ("immutable-properties", + g_param_spec_variant ("immutable-properties", "Immutable properties", "The protocol's immutable properties", - TP_HASH_TYPE_QUALIFIED_PROPERTY_VALUE_MAP, - G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + G_VARIANT_TYPE_VARDICT, + g_variant_new ("a{sv}", NULL), + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); tp_dbus_properties_mixin_implement_interface (object_class, TP_IFACE_QUARK_PROTOCOL, protocol_properties_getter, NULL, diff --git a/telepathy-glib/base-protocol.h b/telepathy-glib/base-protocol.h index 316c83e..b25294a 100644 --- a/telepathy-glib/base-protocol.h +++ b/telepathy-glib/base-protocol.h @@ -159,7 +159,7 @@ struct _TpBaseProtocolClass }; const gchar *tp_base_protocol_get_name (TpBaseProtocol *self); -GHashTable *tp_base_protocol_get_immutable_properties (TpBaseProtocol *self); +GVariant *tp_base_protocol_get_immutable_properties (TpBaseProtocol *self); GPtrArray *tp_base_protocol_dup_parameters (TpBaseProtocol *self); const TpPresenceStatusSpec *tp_base_protocol_get_statuses (TpBaseProtocol *self); diff --git a/telepathy-glib/dbus-properties-mixin.c b/telepathy-glib/dbus-properties-mixin.c index fba9ca0..15f6952 100644 --- a/telepathy-glib/dbus-properties-mixin.c +++ b/telepathy-glib/dbus-properties-mixin.c @@ -659,9 +659,9 @@ tp_dbus_properties_mixin_get (GObject *self, static void -tp_dbus_properties_mixin_fill_properties_hash_va ( +tp_dbus_properties_mixin_fill_properties_va ( GObject *object, - GHashTable *table, + GVariantDict *dict, const gchar *first_interface, const gchar *first_property, va_list ap) @@ -673,7 +673,7 @@ tp_dbus_properties_mixin_fill_properties_hash_va ( iface != NULL; iface = va_arg (ap, gchar *)) { - GValue *value = g_slice_new0 (GValue); + GValue value = G_VALUE_INIT; GError *error = NULL; if (first) @@ -691,12 +691,15 @@ tp_dbus_properties_mixin_fill_properties_hash_va ( */ g_assert (property != NULL); - if (tp_dbus_properties_mixin_get (object, iface, property, value, + if (tp_dbus_properties_mixin_get (object, iface, property, &value, &error)) { - g_assert (G_IS_VALUE (value)); - g_hash_table_insert (table, - g_strdup_printf ("%s.%s", iface, property), value); + gchar *key = g_strdup_printf ("%s.%s", iface, property); + + g_variant_dict_insert_value (dict, key, + dbus_g_value_build_g_variant (&value)); + g_value_unset (&value); + g_free (key); } else { @@ -710,88 +713,36 @@ tp_dbus_properties_mixin_fill_properties_hash_va ( } /** - * tp_dbus_properties_mixin_fill_properties_hash: (skip) + * tp_dbus_properties_mixin_fill_properties: (skip) * @object: an object which uses the D-Bus properties mixin - * @table: (element-type utf8 GObject.Value): a hash table where the keys are - * strings copied with g_strdup() and the values are slice-allocated - * #GValues + * @dict: a #GVariantDict * @first_interface: the interface of the first property to be retrieved * @first_property: the name of the first property to be retrieved * @...: more (interface name, property name) pairs, terminated by %NULL. * * Retrieves the values of several D-Bus properties from an object, and adds - * them to a hash mapping the fully-qualified name of the property to its - * value. This is equivalent to calling tp_dbus_properties_mixin_get() for - * each property and adding it to the table yourself, with the proviso that - * this function will g_assert() if retrieving a property fails (for instance, - * because it does not exist). - * - * Note that in particular, @table does not have the same memory-allocation - * model as the hash tables required by tp_asv_set_string() and similar - * functions. + * them to @dict mapping the fully-qualified name of the property to its + * value. This is equivalent to calling tp_dbus_properties_mixin_get(), for + * each property, convert the value to a #GVariant and adding it to @dict + * yourself, with the proviso that this function will g_assert() if retrieving a + * property fails (for instance, because it does not exist). * * Since: 0.11.11 */ void -tp_dbus_properties_mixin_fill_properties_hash ( - GObject *object, - GHashTable *table, - const gchar *first_interface, - const gchar *first_property, - ...) -{ - va_list ap; - - va_start (ap, first_property); - tp_dbus_properties_mixin_fill_properties_hash_va (object, table, - first_interface, first_property, ap); - va_end (ap); -} - -/** - * tp_dbus_properties_mixin_make_properties_hash: (skip) - * @object: an object which uses the D-Bus properties mixin - * @first_interface: the interface of the first property to be retrieved - * @first_property: the name of the first property to be retrieved - * @...: more (interface name, property name) pairs, terminated by %NULL. - * - * Retrieves the values of several D-Bus properties from an object, and builds - * a hash mapping the fully-qualified name of the property to its value. This - * is equivalent to calling tp_dbus_properties_mixin_get() for each property - * and building the table yourself, with the proviso that this function will - * g_assert() if retrieving a property fails (for instance, because it does not - * exist). - * - * Additional keys and values can be inserted into the returned hash table; - * if this is done, the inserted keys and values will be freed when the - * hash table is destroyed. The keys must be allocated with g_strdup() or - * equivalent, and the values must be slice-allocated (for instance with - * tp_g_value_slice_new_string() or a similar function). - * - * Note that in particular, tp_asv_set_string() and similar functions should - * not be used with this hash table. - * - * Returns: a hash table mapping (gchar *) fully-qualified property names to - * GValues, which must be freed by the caller (at which point its - * contents will also be freed). - */ -GHashTable * -tp_dbus_properties_mixin_make_properties_hash ( +tp_dbus_properties_mixin_fill_properties ( GObject *object, + GVariantDict *dict, const gchar *first_interface, const gchar *first_property, ...) { - GHashTable *table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, - (GDestroyNotify) tp_g_value_slice_free); va_list ap; va_start (ap, first_property); - tp_dbus_properties_mixin_fill_properties_hash_va (object, table, + tp_dbus_properties_mixin_fill_properties_va (object, dict, first_interface, first_property, ap); va_end (ap); - - return table; } /** diff --git a/telepathy-glib/dbus-properties-mixin.h b/telepathy-glib/dbus-properties-mixin.h index c5bf33e..38ddf6e 100644 --- a/telepathy-glib/dbus-properties-mixin.h +++ b/telepathy-glib/dbus-properties-mixin.h @@ -146,13 +146,8 @@ GVariant *tp_dbus_properties_mixin_dup_all_vardict (GObject *object, const gchar *interface_name) G_GNUC_WARN_UNUSED_RESULT; -GHashTable *tp_dbus_properties_mixin_make_properties_hash ( - GObject *object, const gchar *first_interface, - const gchar *first_property, ...) - G_GNUC_NULL_TERMINATED G_GNUC_WARN_UNUSED_RESULT; - -void tp_dbus_properties_mixin_fill_properties_hash (GObject *object, - GHashTable *table, +void tp_dbus_properties_mixin_fill_properties (GObject *object, + GVariantDict *dict, const gchar *first_interface, const gchar *first_property, ...) diff --git a/telepathy-glib/versions/dbus-1.0.abi b/telepathy-glib/versions/dbus-1.0.abi index 54dafc8..5f571fe 100644 --- a/telepathy-glib/versions/dbus-1.0.abi +++ b/telepathy-glib/versions/dbus-1.0.abi @@ -300,11 +300,10 @@ tp_dbus_properties_mixin_dup_all_vardict tp_dbus_properties_mixin_dup_variant tp_dbus_properties_mixin_emit_properties_changed tp_dbus_properties_mixin_emit_properties_changed_varargs -tp_dbus_properties_mixin_fill_properties_hash +tp_dbus_properties_mixin_fill_properties tp_dbus_properties_mixin_get tp_dbus_properties_mixin_getter_gobject_properties tp_dbus_properties_mixin_implement_interface -tp_dbus_properties_mixin_make_properties_hash tp_dbus_properties_mixin_set tp_dbus_properties_mixin_set_variant tp_dbus_properties_mixin_setter_gobject_properties diff --git a/tests/lib/dbus-tube-chan.c b/tests/lib/dbus-tube-chan.c index ab307d2..2681bfe 100644 --- a/tests/lib/dbus-tube-chan.c +++ b/tests/lib/dbus-tube-chan.c @@ -191,14 +191,14 @@ channel_close (TpBaseChannel *channel) static void fill_immutable_properties (TpBaseChannel *chan, - GHashTable *properties) + GVariantDict *properties) { TpBaseChannelClass *klass = TP_BASE_CHANNEL_CLASS ( tp_tests_dbus_tube_channel_parent_class); klass->fill_immutable_properties (chan, properties); - tp_dbus_properties_mixin_fill_properties_hash ( + tp_dbus_properties_mixin_fill_properties ( G_OBJECT (chan), properties, TP_IFACE_CHANNEL_TYPE_DBUS_TUBE1, "ServiceName", TP_IFACE_CHANNEL_TYPE_DBUS_TUBE1, "SupportedAccessControls", @@ -207,7 +207,7 @@ fill_immutable_properties (TpBaseChannel *chan, if (!tp_base_channel_is_requested (chan)) { /* Parameters is immutable only for incoming tubes */ - tp_dbus_properties_mixin_fill_properties_hash ( + tp_dbus_properties_mixin_fill_properties ( G_OBJECT (chan), properties, TP_IFACE_CHANNEL_INTERFACE_TUBE1, "Parameters", NULL); diff --git a/tests/lib/file-transfer-chan.c b/tests/lib/file-transfer-chan.c index 3951ecc..2a6edc7 100644 --- a/tests/lib/file-transfer-chan.c +++ b/tests/lib/file-transfer-chan.c @@ -319,14 +319,14 @@ channel_close (TpBaseChannel *self) static void fill_immutable_properties (TpBaseChannel *self, - GHashTable *properties) + GVariantDict *properties) { TpBaseChannelClass *klass = TP_BASE_CHANNEL_CLASS ( tp_tests_file_transfer_channel_parent_class); klass->fill_immutable_properties (self, properties); - tp_dbus_properties_mixin_fill_properties_hash ( + tp_dbus_properties_mixin_fill_properties ( G_OBJECT (self), properties, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER1, "AvailableSocketTypes", TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER1, "ContentType", @@ -341,7 +341,7 @@ fill_immutable_properties (TpBaseChannel *self, /* URI is immutable only for outgoing transfers */ if (tp_base_channel_is_requested (self)) { - tp_dbus_properties_mixin_fill_properties_hash (G_OBJECT (self), + tp_dbus_properties_mixin_fill_properties (G_OBJECT (self), properties, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER1, "URI", NULL); } diff --git a/tests/lib/room-list-chan.c b/tests/lib/room-list-chan.c index da1ecc2..9d96a60 100644 --- a/tests/lib/room-list-chan.c +++ b/tests/lib/room-list-chan.c @@ -97,14 +97,14 @@ tp_tests_room_list_chan_finalize (GObject *object) static void fill_immutable_properties (TpBaseChannel *chan, - GHashTable *properties) + GVariantDict *properties) { TpBaseChannelClass *klass = TP_BASE_CHANNEL_CLASS ( tp_tests_room_list_chan_parent_class); klass->fill_immutable_properties (chan, properties); - tp_dbus_properties_mixin_fill_properties_hash ( + tp_dbus_properties_mixin_fill_properties ( G_OBJECT (chan), properties, TP_IFACE_CHANNEL_TYPE_ROOM_LIST1, "Server", NULL); diff --git a/tests/lib/stream-tube-chan.c b/tests/lib/stream-tube-chan.c index 39b4dc1..7f11aef 100644 --- a/tests/lib/stream-tube-chan.c +++ b/tests/lib/stream-tube-chan.c @@ -227,14 +227,14 @@ channel_close (TpBaseChannel *channel) static void fill_immutable_properties (TpBaseChannel *chan, - GHashTable *properties) + GVariantDict *properties) { TpBaseChannelClass *klass = TP_BASE_CHANNEL_CLASS ( tp_tests_stream_tube_channel_parent_class); klass->fill_immutable_properties (chan, properties); - tp_dbus_properties_mixin_fill_properties_hash ( + tp_dbus_properties_mixin_fill_properties ( G_OBJECT (chan), properties, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE1, "Service", TP_IFACE_CHANNEL_TYPE_STREAM_TUBE1, "SupportedSocketTypes", @@ -243,7 +243,7 @@ fill_immutable_properties (TpBaseChannel *chan, if (!tp_base_channel_is_requested (chan)) { /* Parameters is immutable only for incoming tubes */ - tp_dbus_properties_mixin_fill_properties_hash ( + tp_dbus_properties_mixin_fill_properties ( G_OBJECT (chan), properties, TP_IFACE_CHANNEL_INTERFACE_TUBE1, "Parameters", NULL); -- 2.1.0