summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.co.uk>2012-09-05 11:15:00 +0200
committerXavier Claessens <xavier.claessens@collabora.co.uk>2012-09-05 15:51:43 +0200
commit8f9b57121072744bb57dd4aa801589e156048072 (patch)
tree440016a1f14c9502cd3c6436850bf21872517932
parent8a628bd8efeee4fe359a72cf56bdde6350c024dc (diff)
downloadtelepathy-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
-rw-r--r--docs/reference/telepathy-glib-sections.txt1
-rw-r--r--telepathy-glib/contact.c25
-rw-r--r--telepathy-glib/contact.h6
3 files changed, 32 insertions, 0 deletions
diff --git a/docs/reference/telepathy-glib-sections.txt b/docs/reference/telepathy-glib-sections.txt
index 7c91be284..a9456221d 100644
--- a/docs/reference/telepathy-glib-sections.txt
+++ b/docs/reference/telepathy-glib-sections.txt
@@ -4992,6 +4992,7 @@ tp_contact_get_presence_type
tp_contact_get_location
tp_contact_get_capabilities
tp_contact_get_contact_info
+tp_contact_dup_contact_info
tp_contact_is_blocked
tp_contact_request_contact_info_async
tp_contact_request_contact_info_finish
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
*
diff --git a/telepathy-glib/contact.h b/telepathy-glib/contact.h
index 56355d90d..84b016b26 100644
--- a/telepathy-glib/contact.h
+++ b/telepathy-glib/contact.h
@@ -106,7 +106,13 @@ GFile *tp_contact_get_avatar_file (TpContact *self);
const gchar *tp_contact_get_avatar_mime_type (TpContact *self);
/* TP_CONTACT_FEATURE_INFO */
+#ifndef TP_DISABLE_DEPRECATED
+_TP_DEPRECATED_IN_0_20_FOR (tp_contact_dup_contact_info)
GList *tp_contact_get_contact_info (TpContact *self);
+#endif
+
+_TP_AVAILABLE_IN_0_20
+GList *tp_contact_dup_contact_info (TpContact *self);
void tp_contact_request_contact_info_async (TpContact *self,
GCancellable *cancellable, GAsyncReadyCallback callback,