From b47184778af59882f81c5383c24d1a8e614c856e Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Wed, 23 Feb 2011 22:36:03 +0100 Subject: [PATCH] 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 20ced525..f0477536 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 053ec66e..4120e9da 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 */