[Xfce4-commits] <midori:master> Be sure to always initialize startup timers

Christian Dywan noreply at xfce.org
Mon Nov 28 23:46:06 CET 2011


Updating branch refs/heads/master
         to 0e93695979d1252985768851aa8c54ad7442d253 (commit)
       from b3344bf6f760b3869278ac294c75468e31817fcc (commit)

commit 0e93695979d1252985768851aa8c54ad7442d253
Author: Christian Dywan <christian at twotoasts.de>
Date:   Mon Nov 28 23:41:32 2011 +0100

    Be sure to always initialize startup timers

 midori/main.c |   17 ++++-------------
 1 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/midori/main.c b/midori/main.c
index b1dc166..c8dfd5a 100644
--- a/midori/main.c
+++ b/midori/main.c
@@ -1237,9 +1237,7 @@ midori_load_extensions (gpointer data)
     KatzeArray* extensions;
     #ifdef G_ENABLE_DEBUG
     gboolean startup_timer = g_getenv ("MIDORI_STARTTIME") != NULL;
-    GTimer* timer;
-    if (startup_timer)
-        timer = g_timer_new ();
+    GTimer* timer = startup_timer ? g_timer_new () : NULL;
     #endif
 
     /* Load extensions */
@@ -1323,7 +1321,7 @@ midori_load_extensions (gpointer data)
 
     #ifdef G_ENABLE_DEBUG
     if (startup_timer)
-        g_debug ("Extensions:\t%f", g_test_timer_elapsed ());
+        g_debug ("Extensions:\t%f", g_timer_elapsed (timer, NULL));
     #endif
 
     return FALSE;
@@ -1369,9 +1367,7 @@ midori_load_session (gpointer data)
     gchar** command = g_object_get_data (G_OBJECT (app), "execute-command");
     #ifdef G_ENABLE_DEBUG
     gboolean startup_timer = g_getenv ("MIDORI_STARTTIME") != NULL;
-    GTimer* timer;
-    if (startup_timer)
-        timer = g_timer_new ();
+    GTimer* timer = startup_timer ? g_timer_new () : NULL;
     #endif
 
     browser = midori_app_create_browser (app);
@@ -1450,7 +1446,7 @@ midori_load_session (gpointer data)
 
     #ifdef G_ENABLE_DEBUG
     if (startup_timer)
-        g_debug ("Session setup:\t%f", g_test_timer_elapsed ());
+        g_debug ("Session setup:\t%f", g_timer_elapsed (timer, NULL));
     #endif
 
     return FALSE;
@@ -2028,11 +2024,6 @@ main (int    argc,
     else
         g_set_application_name (_("Midori"));
 
-    #ifdef G_ENABLE_DEBUG
-    if (startup_timer)
-        g_test_timer_start ();
-    #endif
-
     if (version)
     {
         g_print (


More information about the Xfce4-commits mailing list