[empathy] add empathy_call_factory_register
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] add empathy_call_factory_register
- Date: Tue, 29 Jun 2010 10:46:07 +0000 (UTC)
commit 9694c8d334037461fc11537920d0a01520a032e5
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Tue Jun 29 10:23:42 2010 +0200
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 ab32d06..54377ad 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 56d430e..abd8c92 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 b83d352..f86999c 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]