[Xfce4-commits] <midori:master> Don't add session tabs to the history on startup

Christian Dywan noreply at xfce.org
Wed Feb 23 22:58:01 CET 2011


Updating branch refs/heads/master
         to b47184778af59882f81c5383c24d1a8e614c856e (commit)
       from 43b2d39c1ed79450ceb773019ae7ae95e8c3bb01 (commit)

commit b47184778af59882f81c5383c24d1a8e614c856e
Author: Christian Dywan <christian at twotoasts.de>
Date:   Wed Feb 23 22:36:03 2011 +0100

    Don't add session tabs to the history on startup
    
    Otherwise the startup as a whole causes a lot of disk activity
    that isn't really needed.

 midori/main.c           |    1 +
 midori/midori-browser.c |   15 +++++++++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/midori/main.c b/midori/main.c
index 20ced52..f047753 100644
--- a/midori/main.c
+++ b/midori/main.c
@@ -1288,6 +1288,7 @@ midori_load_session (gpointer data)
     KATZE_ARRAY_FOREACH_ITEM (item, _session)
     {
         g_object_set_data (G_OBJECT (item), "midori-view-append", (void*)1);
+        katze_item_set_meta_integer (item, "dont-write-history", 1);
         midori_browser_add_item (browser, item);
     }
     current = katze_item_get_meta_integer (KATZE_ITEM (_session), "current");
diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 053ec66..4120e9d 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -330,6 +330,8 @@ _midori_browser_update_interface (MidoriBrowser* browser)
                       "sensitive", can_reload, NULL);
         if (!browser->show_navigationbar)
             gtk_widget_hide (browser->navigationbar);
+
+        katze_item_set_meta_integer (midori_view_get_proxy_item (view), "dont-write-history", 0);
     }
     else
     {
@@ -592,8 +594,11 @@ midori_view_notify_title_cb (GtkWidget*     widget,
                 !g_str_has_prefix (proxy_uri, "about:") &&
                 (katze_item_get_meta_integer (proxy, "history-step") == -1))
             {
-                midori_browser_new_history_item (browser, proxy);
-                katze_item_set_meta_integer (proxy, "history-step", 1);
+                if (!katze_item_get_meta_boolean (proxy, "dont-write-history"))
+                {
+                    midori_browser_new_history_item (browser, proxy);
+                    katze_item_set_meta_integer (proxy, "history-step", 1);
+                }
             }
             else if (katze_item_get_name (proxy) &&
                      !g_str_has_prefix (proxy_uri, "about:") &&
@@ -6716,6 +6721,12 @@ midori_browser_add_item (MidoriBrowser* browser,
     title = katze_item_get_name (item);
     view = midori_view_new_with_title (title, browser->settings,
         g_object_get_data (G_OBJECT (item), "midori-view-append") ? TRUE : FALSE);
+
+    proxy_item = midori_view_get_proxy_item (MIDORI_VIEW (view));
+
+    if (katze_item_get_meta_boolean (item, "dont-write-history"))
+        katze_item_set_meta_integer (proxy_item, "dont-write-history", 1);
+
     page = midori_browser_add_tab (browser, view);
 
     /* Blank pages should not be delayed */



More information about the Xfce4-commits mailing list