[next] telepathy-glib: TpProtocol: Deprecate _borrow_ functions
Xavier Claessens
xclaesse at kemper.freedesktop.org
Fri Sep 7 12:08:57 PDT 2012
Module: telepathy-glib
Branch: next
Commit: 8a541d754eddda27039cf759c7228bf2e7f8a10c
URL: http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=8a541d754eddda27039cf759c7228bf2e7f8a10c
Author: Xavier Claessens <xavier.claessens at collabora.co.uk>
Date: Wed Sep 5 11:15:00 2012 +0200
TpProtocol: Deprecate _borrow_ functions
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
There is intentionally no tp_protocol_get_params() because it is internally
an unintrospectable C-array, so a proper container needs to be created. In
next branch they are internally in a GPtrArray so a _get_ function could
be added.
---
telepathy-glib/protocol.c | 13 +++++--------
telepathy-glib/protocol.h | 4 ++++
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/telepathy-glib/protocol.c b/telepathy-glib/protocol.c
index 1214af7..d109890 100644
--- a/telepathy-glib/protocol.c
+++ b/telepathy-glib/protocol.c
@@ -904,7 +904,6 @@ tp_protocol_has_param (TpProtocol *self,
return (tp_protocol_get_param (self, param) != NULL);
}
-/* FIXME: in Telepathy 1.0, rename to tp_protocol_borrow_param or remove */
/**
* tp_protocol_get_param:
* @self: a protocol
@@ -917,7 +916,8 @@ tp_protocol_has_param (TpProtocol *self,
*
* Since: 0.11.11
*/
-const TpConnectionManagerParam *tp_protocol_get_param (TpProtocol *self,
+const TpConnectionManagerParam *
+tp_protocol_get_param (TpProtocol *self,
const gchar *param)
{
g_return_val_if_fail (TP_IS_PROTOCOL (self), FALSE);
@@ -927,7 +927,6 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
G_GNUC_END_IGNORE_DEPRECATIONS
}
-/* FIXME: in Telepathy 1.0, rename to tp_protocol_get_param */
/**
* tp_protocol_dup_param:
* @self: a protocol
@@ -946,11 +945,7 @@ tp_protocol_dup_param (TpProtocol *self,
{
g_return_val_if_fail (TP_IS_PROTOCOL (self), NULL);
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- return tp_connection_manager_param_copy (
- tp_connection_manager_protocol_get_param (
- &self->priv->protocol_struct, param));
-G_GNUC_END_IGNORE_DEPRECATIONS
+ return tp_connection_manager_param_copy (tp_protocol_get_param (self, param));
}
/**
@@ -1006,6 +1001,8 @@ G_GNUC_END_IGNORE_DEPRECATIONS
* terminated by one whose @name is %NULL
*
* Since: 0.17.6
+ * Deprecated: Since 0.UNRELEASED. New code should use tp_protocol_dup_params()
+ * instead.
*/
const TpConnectionManagerParam *
tp_protocol_borrow_params (TpProtocol *self)
diff --git a/telepathy-glib/protocol.h b/telepathy-glib/protocol.h
index af64c3a..bc36c5a 100644
--- a/telepathy-glib/protocol.h
+++ b/telepathy-glib/protocol.h
@@ -101,9 +101,13 @@ gboolean tp_protocol_can_register (TpProtocol *self);
GStrv tp_protocol_dup_param_names (TpProtocol *self) G_GNUC_WARN_UNUSED_RESULT;
_TP_AVAILABLE_IN_0_18
GList *tp_protocol_dup_params (TpProtocol *self) G_GNUC_WARN_UNUSED_RESULT;
+
+#ifndef TP_DISABLE_DEPRECATED
+_TP_DEPRECATED_IN_0_20_FOR(tp_protocol_dup_params)
_TP_AVAILABLE_IN_0_18
const TpConnectionManagerParam *tp_protocol_borrow_params (TpProtocol *self)
G_GNUC_WARN_UNUSED_RESULT;
+#endif
const gchar * const *
/* gtk-doc sucks */
More information about the telepathy-commits
mailing list