From 9888ad610d4285d1306155a032c3537a1917dd91 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Wed, 7 Dec 2011 23:01:50 +0100 Subject: [PATCH] Avoid extra loop for adding delay to all items --- midori/main.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/midori/main.c b/midori/main.c index bdfe414b..14de34a1 100644 --- a/midori/main.c +++ b/midori/main.c @@ -595,17 +595,6 @@ midori_bookmarks_import (const gchar* filename, midori_bookmarks_import_array_db (db, bookmarks, ""); } -static void -midori_session_add_delay (KatzeArray* session) -{ - KatzeItem* item; - KATZE_ARRAY_FOREACH_ITEM (item, session) - { - if (katze_item_get_meta_integer (item, "delay") == -1) - katze_item_set_meta_integer (item, "delay", 1); - } -} - static void settings_notify_cb (MidoriWebSettings* settings, GParamSpec* pspec, @@ -1406,14 +1395,14 @@ midori_load_session (gpointer data) g_object_unref (item); } - if (load_on_startup == MIDORI_STARTUP_DELAYED_PAGES) - midori_session_add_delay (_session); - session = midori_browser_get_proxy_array (browser); 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); + if (load_on_startup == MIDORI_STARTUP_DELAYED_PAGES + && katze_item_get_meta_integer (item, "delay") == -1) + katze_item_set_meta_integer (item, "delay", 1); midori_browser_add_item (browser, item); } current = katze_item_get_meta_integer (KATZE_ITEM (_session), "current"); -- 2.39.5