diff options
author | Xavier Claessens <xavier.claessens@collabora.co.uk> | 2012-09-05 11:15:00 +0200 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.co.uk> | 2012-09-05 15:51:43 +0200 |
commit | 8f9b57121072744bb57dd4aa801589e156048072 (patch) | |
tree | 440016a1f14c9502cd3c6436850bf21872517932 /telepathy-glib/contact.c | |
parent | 8a628bd8efeee4fe359a72cf56bdde6350c024dc (diff) | |
download | telepathy-glib-8f9b57121072744bb57dd4aa801589e156048072.tar.gz |
TpContact: Deprecate _get_ functions returning a GList and replace them by _dup_
New transfer and naming policy has been discussed in
https://bugs.freedesktop.org/show_bug.cgi?id=39189 and is
documented there: http://telepathy.freedesktop.org/wiki/Style/TelepathyGLib
Diffstat (limited to 'telepathy-glib/contact.c')
-rw-r--r-- | telepathy-glib/contact.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/telepathy-glib/contact.c b/telepathy-glib/contact.c index 2827dec8b..ea2c178a7 100644 --- a/telepathy-glib/contact.c +++ b/telepathy-glib/contact.c @@ -609,6 +609,8 @@ tp_contact_get_capabilities (TpContact *self) * a #GList of #TpContactInfoField, or %NULL if the feature is not yet * prepared. * Since: 0.11.7 + * Deprecated: Since 0.UNRELEASED. New code should use + * tp_contact_dup_contact_info() instead. */ GList * tp_contact_get_contact_info (TpContact *self) @@ -619,6 +621,29 @@ tp_contact_get_contact_info (TpContact *self) } /** + * tp_contact_dup_contact_info: + * @self: a #TpContact + * + * Returns a newly allocated #GList of contact's vCard fields. The list must be + * freed with tp_contact_info_list_free() after used. + * + * Same as the #TpContact:contact-info property. + * + * Returns: (element-type TelepathyGLib.ContactInfoField) (transfer full): + * a #GList of #TpContactInfoField, or %NULL if the feature is not yet + * prepared. + * Since: 0.UNRELEASED + */ +GList * +tp_contact_dup_contact_info (TpContact *self) +{ + g_return_val_if_fail (TP_IS_CONTACT (self), NULL); + + return _tp_g_list_copy_deep (self->priv->contact_info, + (GCopyFunc) tp_contact_info_field_copy, NULL); +} + +/** * tp_contact_get_subscribe_state: * @self: a #TpContact * |