From 9694c8d334037461fc11537920d0a01520a032e5 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 29 Jun 2010 10:23:42 +0200 Subject: add empathy_call_factory_register So we can connect signal before registering the Handler. --- libempathy/empathy-call-factory.c | 15 +++++++++------ libempathy/empathy-call-factory.h | 3 +++ src/empathy-av.c | 8 ++++++++ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/libempathy/empathy-call-factory.c b/libempathy/empathy-call-factory.c index ab32d06ad..54377ad7a 100644 --- a/libempathy/empathy-call-factory.c +++ b/libempathy/empathy-call-factory.c @@ -107,12 +107,6 @@ empathy_call_factory_init (EmpathyCallFactory *obj) "org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/gtalk-p2p", NULL); - if (!tp_base_client_register (priv->handler, &error)) - { - g_warning ("Failed to register Handler: %s", error->message); - g_error_free (error); - } - g_object_unref (dbus); } @@ -306,3 +300,12 @@ handle_channels_cb (TpSimpleHandler *handler, tp_handle_channels_context_accept (context); } + +gboolean +empathy_call_factory_register (EmpathyCallFactory *self, + GError **error) +{ + EmpathyCallFactoryPriv *priv = GET_PRIV (self); + + return tp_base_client_register (priv->handler, error); +} diff --git a/libempathy/empathy-call-factory.h b/libempathy/empathy-call-factory.h index 56d430ed4..abd8c92dc 100644 --- a/libempathy/empathy-call-factory.h +++ b/libempathy/empathy-call-factory.h @@ -72,6 +72,9 @@ void empathy_call_factory_new_call_with_streams (EmpathyContact *contact, EmpathyDispatcherRequestCb callback, gpointer user_data); +gboolean empathy_call_factory_register (EmpathyCallFactory *self, + GError **error); + G_END_DECLS #endif /* #ifndef __EMPATHY_CALL_FACTORY_H__*/ diff --git a/src/empathy-av.c b/src/empathy-av.c index b83d3525c..f86999cba 100644 --- a/src/empathy-av.c +++ b/src/empathy-av.c @@ -62,6 +62,7 @@ main (int argc, TpDebugSender *debug_sender; #endif EmpathyCallFactory *call_factory; + GError *error = NULL; /* Init */ g_thread_init (NULL); @@ -99,6 +100,13 @@ main (int argc, g_signal_connect (G_OBJECT (call_factory), "new-call-handler", G_CALLBACK (new_call_handler_cb), NULL); + if (!empathy_call_factory_register (call_factory, &error)) + { + g_critical ("Failed to register Handler: %s", error->message); + g_error_free (error); + return EXIT_FAILURE; + } + gtk_main (); g_object_unref (call_factory); -- cgit v1.2.3