]> spindle.queued.net Git - midori/commitdiff
Let Ctrl+K load default search website if no Search in the toolbar
authorMike Massonnet <mmassonnet@gmail.com>
Wed, 6 May 2009 00:41:17 +0000 (02:41 +0200)
committerChristian Dywan <christian@twotoasts.de>
Wed, 6 May 2009 00:45:59 +0000 (02:45 +0200)
midori/midori-browser.c

index 9701fa5cb3b8f5f6eda86d06deaf27a779e81fc0..b9a048e398150a82e003980b822a42943fe36e01 100644 (file)
@@ -2796,6 +2796,9 @@ _action_search_activate (GtkAction*     action,
     GSList* proxies = gtk_action_get_proxies (action);
     guint i = 0;
     GtkWidget* proxy;
+    const gchar* uri;
+    gchar* search;
+
     while (((proxy = g_slist_nth_data (proxies, i++))))
         if (GTK_IS_TOOL_ITEM (proxy))
         {
@@ -2803,8 +2806,13 @@ _action_search_activate (GtkAction*     action,
                 gtk_widget_show (browser->navigationbar);
             return;
         }
-    _action_search_submit (action, "", FALSE, browser);
+
+    /* Load default search engine in current tab */
+    uri = browser->location_entry_search;
+    search = sokoke_search_uri (uri ? uri : "", "");
+    midori_browser_set_current_uri (browser, search);
     gtk_widget_grab_focus (midori_browser_get_current_tab (browser));
+    g_free (search);
 }
 
 static void