From 6a49642b77eb9d6e50e51f00b1a563c692085e4c Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 2 Mar 2012 13:50:26 +0000 Subject: [PATCH 1/5] tp_proxy_add_interface_by_id: return void --- telepathy-glib/proxy-subclass.h | 2 +- telepathy-glib/proxy.c | 16 ++++------------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/telepathy-glib/proxy-subclass.h b/telepathy-glib/proxy-subclass.h index 7399954..50ee188 100644 --- a/telepathy-glib/proxy-subclass.h +++ b/telepathy-glib/proxy-subclass.h @@ -64,7 +64,7 @@ void tp_proxy_or_subclass_hook_on_interface_add (GType proxy_or_subclass, DBusGProxy *tp_proxy_borrow_interface_by_id (TpProxy *self, GQuark iface, GError **error); -DBusGProxy *tp_proxy_add_interface_by_id (TpProxy *self, GQuark iface); +void tp_proxy_add_interface_by_id (TpProxy *self, GQuark iface); void tp_proxy_add_interfaces (TpProxy *self, const gchar * const *interfaces); void tp_proxy_invalidate (TpProxy *self, const GError *error); diff --git a/telepathy-glib/proxy.c b/telepathy-glib/proxy.c index 8f171a9..e8996e9 100644 --- a/telepathy-glib/proxy.c +++ b/telepathy-glib/proxy.c @@ -640,26 +640,20 @@ tp_proxy_iface_destroyed_cb (DBusGProxy *dgproxy, * If the interface is the proxy's "main interface", or has already been * added, then do nothing. * - * Returns: either %NULL or a borrowed #DBusGProxy corresponding to @iface, - * depending on implementation details. To reliably borrow the #DBusGProxy, use - * tp_proxy_borrow_interface_by_id(). (This method should probably have - * returned void; sorry.) - * * Since: 0.7.1 */ -DBusGProxy * +void tp_proxy_add_interface_by_id (TpProxy *self, GQuark iface) { DBusGProxy *iface_proxy = g_datalist_id_get_data (&self->priv->interfaces, iface); - g_return_val_if_fail + g_return_if_fail (tp_dbus_check_valid_interface_name (g_quark_to_string (iface), - NULL), - NULL); + NULL)); - g_return_val_if_fail (tp_proxy_get_invalidated (self) == NULL, NULL); + g_return_if_fail (tp_proxy_get_invalidated (self) == NULL); if (iface_proxy == NULL) { @@ -670,8 +664,6 @@ tp_proxy_add_interface_by_id (TpProxy *self, g_datalist_id_set_data_full (&self->priv->interfaces, iface, self, NULL); } - - return iface_proxy; } /** -- 1.7.9.1