summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-04-16 17:17:04 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-04-17 14:22:30 +0100
commit1790864c868d3348d3ff873efb82c174943a7c2a (patch)
treee788ddc98bc2b1f6111a9c08a3d339d1da45d2c2
parent1ea36afc3ee47f1516dc6fa1f3001a66e75fd05f (diff)
_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.
-rw-r--r--telepathy-glib/base-connection-internal.h2
-rw-r--r--telepathy-glib/base-connection.c13
-rw-r--r--telepathy-glib/base-contact-list.c3
3 files changed, 9 insertions, 9 deletions
diff --git a/telepathy-glib/base-connection-internal.h b/telepathy-glib/base-connection-internal.h
index 2c572ec77..ae669cc56 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 eaa098c5f..0087d4d97 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@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 196583237..ed19d31b3 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;