[Xfce4-commits] <midori:master> Use optimized code path for current tab

Christian Dywan noreply at xfce.org
Thu Jul 5 00:46:01 CEST 2012


Updating branch refs/heads/master
         to e8cbe34aeb4e26b79fd2d60547e2f0a15adb5097 (commit)
       from 120f7440f6c6294fce8adfd495b5fcb897cf559e (commit)

commit e8cbe34aeb4e26b79fd2d60547e2f0a15adb5097
Author: Christian Dywan <christian at twotoasts.de>
Date:   Wed Jul 4 23:55:31 2012 +0200

    Use optimized code path for current tab

 midori/midori-browser.c |   29 ++++++++---------------------
 1 files changed, 8 insertions(+), 21 deletions(-)

diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 8c6087a..a193407 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -1559,13 +1559,7 @@ midori_browser_tab_destroy_cb (GtkWidget*     widget,
        so just create an empty one if the last one is closed.
        The only exception is when we are closing the window,
        which is indicated by the proxy array having been unset. */
-    #ifdef HAVE_GRANITE
-    if (midori_browser_get_current_tab (browser) && midori_browser_get_n_pages (browser) > 0)
-        g_warning ("FIXME granite_widgets_get_current returns NULL");
-    if (browser->proxy_array && !midori_browser_get_n_pages (browser))
-    #else
     if (browser->proxy_array && !midori_browser_get_current_tab (browser))
-    #endif
         midori_browser_add_uri (browser, "");
     return FALSE;
 }
@@ -7822,26 +7816,19 @@ midori_browser_set_current_tab (MidoriBrowser* browser,
 GtkWidget*
 midori_browser_get_current_tab (MidoriBrowser* browser)
 {
-    gint n;
+    #ifdef HAVE_GRANITE
+    GraniteWidgetsTab* tab;
+    #endif
 
     g_return_val_if_fail (MIDORI_IS_BROWSER (browser), NULL);
 
-    n = midori_browser_get_current_page (browser);
-    if (n >= 0)
-        return midori_browser_get_nth_tab (browser, n);
     #ifdef HAVE_GRANITE
-    else
-    {
-        GraniteWidgetsTab* tab = granite_widgets_dynamic_notebook_get_current (
-            GRANITE_WIDGETS_DYNAMIC_NOTEBOOK (browser->notebook));
-        g_warning ("FIXME granite_widgets_get_tab_position returns NULL");
-        if (tab == NULL)
-            g_warning ("granite_widgets_dynamic_notebook_get_current returns NULL");
-        return tab ? granite_widgets_tab_get_page (tab) : NULL;
-    }
+    tab = granite_widgets_dynamic_notebook_get_current (
+        GRANITE_WIDGETS_DYNAMIC_NOTEBOOK (browser->notebook));
+    return tab ? granite_widgets_tab_get_page (tab) : NULL;
     #else
-    else
-        return NULL;
+    return midori_browser_get_nth_tab (browser,
+        midori_browser_get_current_page (browser));
     #endif
 }
 


More information about the Xfce4-commits mailing list