[Pkg-telepathy-commits] [telepathy-glib-1] 188/212: _tp_base_connection_dup_contact_attributes: de-confuse name
Simon McVittie
smcv at debian.org
Wed May 14 12:09:14 UTC 2014
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch debian
in repository telepathy-glib-1.
commit bf8811e500282207378f33a99ba63fbb71712b10
Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date: Wed Apr 16 17:17:04 2014 +0100
_tp_base_connection_dup_contact_attributes: de-confuse name
Two things were confusing about its name: it ended with _hash but
didn't return a GHashTable any more, and it contained _dup_ but didn't
return a ref.
Reviewed-by: Xavier Claessens <xavier.claessens at collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189
---
telepathy-glib/base-connection-internal.h | 2 +-
telepathy-glib/base-connection.c | 13 ++++++-------
telepathy-glib/base-contact-list.c | 3 ++-
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/telepathy-glib/base-connection-internal.h b/telepathy-glib/base-connection-internal.h
index 2c572ec..ae669cc 100644
--- a/telepathy-glib/base-connection-internal.h
+++ b/telepathy-glib/base-connection-internal.h
@@ -93,7 +93,7 @@ void _tp_base_connection_set_handle_repo (TpBaseConnection *self,
gpointer _tp_base_connection_find_channel_manager (TpBaseConnection *self,
GType type);
-GVariant *_tp_base_connection_dup_contact_attributes_hash (
+GVariant *_tp_base_connection_dup_contact_attributes (
TpBaseConnection *self,
const GArray *handles,
const gchar * const *interfaces,
diff --git a/telepathy-glib/base-connection.c b/telepathy-glib/base-connection.c
index eaa098c..0087d4d 100644
--- a/telepathy-glib/base-connection.c
+++ b/telepathy-glib/base-connection.c
@@ -2660,11 +2660,10 @@ static const gchar * const contacts_always_included_interfaces[] = {
* the behaviour is defined by the interface; the attribute should either
* be omitted from the result or replaced with a default value.
*
- * Returns: a floating GVariant of type "a{ua{sv}}"
- * Since: 0.99.6
+ * Returns: (transfer full): a #GVariant of type "a{ua{sv}}"
*/
GVariant *
-_tp_base_connection_dup_contact_attributes_hash (TpBaseConnection *self,
+_tp_base_connection_dup_contact_attributes (TpBaseConnection *self,
const GArray *handles,
const gchar * const *interfaces,
const gchar * const *assumed_interfaces)
@@ -2724,7 +2723,7 @@ _tp_base_connection_dup_contact_attributes_hash (TpBaseConnection *self,
g_variant_dict_end (&dict));
}
- return g_variant_builder_end (&builder);
+ return g_variant_ref_sink (g_variant_builder_end (&builder));
}
static gboolean
@@ -2753,13 +2752,14 @@ contacts_get_contact_attributes_impl (_TpGDBusConnection *skeleton,
array = g_array_sized_new (FALSE, FALSE, sizeof (TpHandle), n);
g_array_append_vals (array, c_array, n);
- result = _tp_base_connection_dup_contact_attributes_hash (conn,
+ result = _tp_base_connection_dup_contact_attributes (conn,
array, interfaces, contacts_always_included_interfaces);
_tp_gdbus_connection_complete_get_contact_attributes (skeleton, context,
result);
g_array_unref (array);
+ g_variant_unref (result);
return TRUE;
}
@@ -2797,10 +2797,9 @@ ensure_handle_cb (GObject *source,
handles = g_array_new (FALSE, FALSE, sizeof (TpHandle));
g_array_append_val (handles, handle);
- attributes = _tp_base_connection_dup_contact_attributes_hash (self,
+ attributes = _tp_base_connection_dup_contact_attributes (self,
handles, (const gchar * const *) data->interfaces,
contacts_always_included_interfaces);
- g_variant_ref_sink (attributes);
g_variant_get_child (attributes, 0, "{u at a{sv}}", &ret_handle, &ret);
g_assert (ret_handle == handle);
diff --git a/telepathy-glib/base-contact-list.c b/telepathy-glib/base-contact-list.c
index 1965832..ed19d31 100644
--- a/telepathy-glib/base-contact-list.c
+++ b/telepathy-glib/base-contact-list.c
@@ -3691,7 +3691,7 @@ tp_base_contact_list_mixin_get_contact_list_attributes (
set = tp_base_contact_list_dup_contacts (self);
contacts = tp_handle_set_to_array (set);
- result = _tp_base_connection_dup_contact_attributes_hash (
+ result = _tp_base_connection_dup_contact_attributes (
self->priv->conn, contacts, interfaces, assumed);
_tp_gdbus_connection_interface_contact_list1_complete_get_contact_list_attributes (
@@ -3699,6 +3699,7 @@ tp_base_contact_list_mixin_get_contact_list_attributes (
g_array_unref (contacts);
tp_handle_set_destroy (set);
+ g_variant_unref (result);
}
return TRUE;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/telepathy-glib-1.git
More information about the Pkg-telepathy-commits
mailing list