[empathy] empathy-av: early return if already activated



commit 13b07c1ae1c92c9b0a431576f6c78c95a46060fb
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Tue Nov 23 10:44:55 2010 +0100

    empathy-av: early return if already activated
    
    Purely esthetic change to look more like empathy-chat.c

 src/empathy-av.c |   36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)
---
diff --git a/src/empathy-av.c b/src/empathy-av.c
index 5b46307..2313b22 100644
--- a/src/empathy-av.c
+++ b/src/empathy-av.c
@@ -72,29 +72,29 @@ new_call_handler_cb (EmpathyCallFactory *factory,
 static void
 activate_cb (GApplication *application)
 {
-  if (!activated)
-    {
-      GError *error = NULL;
+  GError *error = NULL;
+
+  if (activated)
+    return;
 
-      if (!use_timer)
-        {
-          /* keep a 'ref' to the application */
-          g_application_hold (G_APPLICATION (app));
-        }
+  activated = TRUE;
 
-      g_assert (call_factory == NULL);
-      call_factory = empathy_call_factory_initialise ();
+  if (!use_timer)
+    {
+      /* keep a 'ref' to the application */
+      g_application_hold (G_APPLICATION (app));
+    }
 
-      g_signal_connect (G_OBJECT (call_factory), "new-call-handler",
-          G_CALLBACK (new_call_handler_cb), NULL);
+  g_assert (call_factory == NULL);
+  call_factory = empathy_call_factory_initialise ();
 
-      if (!empathy_call_factory_register (call_factory, &error))
-        {
-          g_critical ("Failed to register Handler: %s", error->message);
-          g_error_free (error);
-        }
+  g_signal_connect (G_OBJECT (call_factory), "new-call-handler",
+      G_CALLBACK (new_call_handler_cb), NULL);
 
-      activated = TRUE;
+  if (!empathy_call_factory_register (call_factory, &error))
+    {
+      g_critical ("Failed to register Handler: %s", error->message);
+      g_error_free (error);
     }
 }
 



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