From e66ea168c21a0be6506329ca87d2f9b028e7d8c8 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sun, 15 May 2011 21:40:39 +0200 Subject: [PATCH] Track selected search engine per window --- midori/midori-browser.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 13998260..e4079392 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -101,6 +101,7 @@ struct _MidoriBrowser gboolean show_statusbar; guint maximum_history_age; gchar* location_entry_search; + guint last_web_search; gchar* news_aggregator; }; @@ -3797,13 +3798,11 @@ _action_search_submit (GtkAction* action, gboolean new_tab, MidoriBrowser* browser) { - guint last_web_search; KatzeItem* item; const gchar* url; gchar* search; - g_object_get (browser->settings, "last-web-search", &last_web_search, NULL); - item = katze_array_get_nth_item (browser->search_engines, last_web_search); + item = katze_array_get_nth_item (browser->search_engines, browser->last_web_search); if (item) url = katze_item_get_uri (item); else /* The location entry search is our fallback */ @@ -3862,6 +3861,7 @@ _action_search_notify_current_item (GtkAction* action, idx = 0; g_object_set (browser->settings, "last-web-search", idx, NULL); + browser->last_web_search = idx; } static void @@ -6352,7 +6352,6 @@ _midori_browser_update_settings (MidoriBrowser* browser) gboolean show_panel; MidoriToolbarStyle toolbar_style; gchar* toolbar_items; - gint last_web_search; gboolean close_buttons_on_tabs; KatzeItem* item; @@ -6377,7 +6376,6 @@ _midori_browser_update_settings (MidoriBrowser* browser) "show-statusbar", &browser->show_statusbar, "toolbar-style", &toolbar_style, "toolbar-items", &toolbar_items, - "last-web-search", &last_web_search, "location-entry-search", &browser->location_entry_search, "close-buttons-on-tabs", &close_buttons_on_tabs, "maximum-history-age", &browser->maximum_history_age, @@ -6425,7 +6423,7 @@ _midori_browser_update_settings (MidoriBrowser* browser) if (browser->search_engines) { item = katze_array_get_nth_item (browser->search_engines, - last_web_search); + browser->last_web_search); if (item) midori_search_action_set_current_item (MIDORI_SEARCH_ACTION ( _action_by_name (browser, "Search")), item); @@ -6713,7 +6711,6 @@ midori_browser_set_property (GObject* object, GParamSpec* pspec) { MidoriBrowser* browser = MIDORI_BROWSER (object); - guint last_web_search; KatzeItem* item; switch (prop_id) @@ -6772,8 +6769,8 @@ midori_browser_set_property (GObject* object, if (browser->search_engines) { - g_object_get (browser->settings, "last-web-search", &last_web_search, NULL); - item = katze_array_get_nth_item (browser->search_engines, last_web_search); + g_object_get (browser->settings, "last-web-search", &browser->last_web_search, NULL); + item = katze_array_get_nth_item (browser->search_engines, browser->last_web_search); midori_search_action_set_current_item (MIDORI_SEARCH_ACTION ( _action_by_name (browser, "Search")), item); -- 2.39.5