]> git.0d.be Git - empathy.git/commitdiff
empathy-av: early return if already activated
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 23 Nov 2010 09:44:55 +0000 (10:44 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 23 Nov 2010 09:44:59 +0000 (10:44 +0100)
Purely esthetic change to look more like empathy-chat.c

src/empathy-av.c

index 5b46307ccf93fbf790c00200897f413100f969fd..2313b22fc32ef97c3f93017c8ddc709c94870518 100644 (file)
@@ -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);
     }
 }