[next] telepathy-glib: tp_automatic_client_factory_new() now returns a TpSimpleClientFactory*
Xavier Claessens
xclaesse at kemper.freedesktop.org
Wed Apr 25 09:12:06 PDT 2012
Module: telepathy-glib
Branch: next
Commit: 96f71247990d446ee27cae012b431550d7c40068
URL: http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=96f71247990d446ee27cae012b431550d7c40068
Author: Xavier Claessens <xavier.claessens at collabora.co.uk>
Date: Tue Apr 24 14:27:46 2012 +0200
tp_automatic_client_factory_new() now returns a TpSimpleClientFactory*
All useful API is on the base class, so returning a TpAutomaticClientFactory
is useless and force ugly casting. It is common usage to return
base class.
---
telepathy-glib/automatic-client-factory.c | 2 +-
telepathy-glib/automatic-client-factory.h | 2 +-
telepathy-glib/base-client.c | 4 ++--
telepathy-glib/proxy.c | 3 +--
tests/dbus/call-channel.c | 3 +--
5 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/telepathy-glib/automatic-client-factory.c b/telepathy-glib/automatic-client-factory.c
index a63a82a..6c1fcc5 100644
--- a/telepathy-glib/automatic-client-factory.c
+++ b/telepathy-glib/automatic-client-factory.c
@@ -277,7 +277,7 @@ tp_automatic_client_factory_class_init (TpAutomaticClientFactoryClass *cls)
*
* Since: 0.15.5
*/
-TpAutomaticClientFactory *
+TpSimpleClientFactory *
tp_automatic_client_factory_new (TpDBusDaemon *dbus)
{
return g_object_new (TP_TYPE_AUTOMATIC_CLIENT_FACTORY,
diff --git a/telepathy-glib/automatic-client-factory.h b/telepathy-glib/automatic-client-factory.h
index 2f7c880..8601ade 100644
--- a/telepathy-glib/automatic-client-factory.h
+++ b/telepathy-glib/automatic-client-factory.h
@@ -61,7 +61,7 @@ GType tp_automatic_client_factory_get_type (void);
(G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_AUTOMATIC_CLIENT_FACTORY, \
TpAutomaticClientFactoryClass))
-TpAutomaticClientFactory *tp_automatic_client_factory_new (TpDBusDaemon *dbus);
+TpSimpleClientFactory *tp_automatic_client_factory_new (TpDBusDaemon *dbus);
G_END_DECLS
diff --git a/telepathy-glib/base-client.c b/telepathy-glib/base-client.c
index 0b36156..029ec1f 100644
--- a/telepathy-glib/base-client.c
+++ b/telepathy-glib/base-client.c
@@ -1156,8 +1156,8 @@ tp_base_client_constructed (GObject *object)
if (self->priv->dbus == NULL)
self->priv->dbus = tp_dbus_daemon_dup (NULL);
- self->priv->factory = (TpSimpleClientFactory *)
- tp_automatic_client_factory_new (self->priv->dbus);
+ self->priv->factory = tp_automatic_client_factory_new (
+ self->priv->dbus);
}
}
diff --git a/telepathy-glib/proxy.c b/telepathy-glib/proxy.c
index 8835e4a..a359bdb 100644
--- a/telepathy-glib/proxy.c
+++ b/telepathy-glib/proxy.c
@@ -1406,8 +1406,7 @@ _tp_proxy_ensure_factory (gpointer proxy,
}
else
{
- self->priv->factory = (TpSimpleClientFactory *)
- tp_automatic_client_factory_new (self->dbus_daemon);
+ self->priv->factory = tp_automatic_client_factory_new (self->dbus_daemon);
}
_tp_simple_client_factory_insert_proxy (self->priv->factory, self);
diff --git a/tests/dbus/call-channel.c b/tests/dbus/call-channel.c
index 528912e..71c53b7 100644
--- a/tests/dbus/call-channel.c
+++ b/tests/dbus/call-channel.c
@@ -107,8 +107,7 @@ setup (Test *test,
"example", parameters, &bus_name, &object_path, &test->error, NULL);
g_assert_no_error (test->error);
- test->factory = (TpSimpleClientFactory *)
- tp_automatic_client_factory_new (test->dbus);
+ test->factory = tp_automatic_client_factory_new (test->dbus);
tp_simple_client_factory_add_channel_features_varargs (test->factory,
TP_CHANNEL_FEATURE_CONTACTS,
0);
More information about the telepathy-commits
mailing list