[empathy] CallWindow: unconditionally connect to notify::call-channel



commit a3086b1cb486653391d90e34539fe9277b4d2d08
Author: Emilio Pozuelo Monfort <emilio pozuelo collabora co uk>
Date:   Thu Sep 8 15:17:24 2011 +0100

    CallWindow: unconditionally connect to notify::call-channel
    
    Since we can get a new call channel if we e.g. hangup and
    then call again.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=655356

 src/empathy-call-window.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index ad3653b..ca1741d 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -3468,19 +3468,20 @@ empathy_call_window_connect_handler (EmpathyCallWindow *self)
   g_signal_connect (priv->handler, "sink-pad-removed",
     G_CALLBACK (empathy_call_window_sink_removed_cb), self);
 
+  /* We connect to ::call-channel unconditionally since we'll
+   * get new channels if we hangup and redial or if we reuse the
+   * call window. */
+  g_signal_connect (priv->handler, "notify::call-channel",
+    G_CALLBACK (call_handler_notify_call_cb), window);
+
   g_object_get (priv->handler, "call-channel", &call, NULL);
   if (call != NULL)
     {
+      /* We won't get notify::call-channel for this channel, so
+       * directly call the callback. */
       call_handler_notify_call_cb (priv->handler, NULL, self);
       g_object_unref (call);
     }
-  else
-    {
-      /* call-channel doesn't exist yet, we'll connect signals once it has been
-       * set */
-      g_signal_connect (priv->handler, "notify::call-channel",
-        G_CALLBACK (call_handler_notify_call_cb), self);
-    }
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]