[Xfce4-commits] <midori:master> Only set search in the browser if we have any search engines

Christian Dywan noreply at xfce.org
Sat Nov 21 06:54:01 CET 2009


Updating branch refs/heads/master
         to 3253f1605a533ee63b7060a08164fcb2158a0ea5 (commit)
       from f14b7119019367ddd9445e0ae04ffdb4034a2f8b (commit)

commit 3253f1605a533ee63b7060a08164fcb2158a0ea5
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sat Nov 21 06:36:35 2009 +0100

    Only set search in the browser if we have any search engines
    
    This fixes the test case which broke when we made settings obligatory.

 midori/midori-browser.c |   27 +++++++++++++++------------
 1 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 2a8f96a..be6925a 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -6446,19 +6446,22 @@ midori_browser_set_property (GObject*      object,
             _action_by_name (browser, "Search")), browser->search_engines);
         /* FIXME: Connect to updates */
 
-        g_object_get (browser->settings, "last-web-search", &last_web_search, NULL);
-        item = katze_array_get_nth_item (browser->search_engines, last_web_search);
-        midori_search_action_set_current_item (MIDORI_SEARCH_ACTION (
-            _action_by_name (browser, "Search")), item);
-
-        i = 0;
-        while ((item = katze_array_get_nth_item (browser->search_engines, i++)))
-            if (!g_strcmp0 (katze_item_get_uri (item), browser->location_entry_search))
-            {
-                midori_search_action_set_default_item (MIDORI_SEARCH_ACTION (
+        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);
+            midori_search_action_set_current_item (MIDORI_SEARCH_ACTION (
                 _action_by_name (browser, "Search")), item);
-                break;
-            }
+
+            i = 0;
+            while ((item = katze_array_get_nth_item (browser->search_engines, i++)))
+                if (!g_strcmp0 (katze_item_get_uri (item), browser->location_entry_search))
+                {
+                    midori_search_action_set_default_item (MIDORI_SEARCH_ACTION (
+                    _action_by_name (browser, "Search")), item);
+                    break;
+                }
+        }
         break;
     }
     case PROP_HISTORY:



More information about the Xfce4-commits mailing list