From ffe63b2868201600e3c0bf9f203de387c3616c40 Mon Sep 17 00:00:00 2001 From: Carl van Tonder Date: Tue, 8 Dec 2009 18:14:52 +0200 Subject: Add gconf key to control the search engine used in auto-search Defaults to Google, like it used to. Bug #604087 Signed-off-by: Xan Lopez --- embed/ephy-web-view.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'embed') diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index 09172b423..a0a7c3a33 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -36,6 +36,7 @@ #include "ephy-embed-single.h" #include "ephy-embed-type-builtins.h" #include "ephy-embed-utils.h" +#include "ephy-prefs.h" #include "ephy-marshal.h" #include "ephy-permission-manager.h" #include "ephy-favicon-cache.h" @@ -1128,10 +1129,21 @@ normalize_or_autosearch_url (EphyWebView *view, const char *url) if (soup_uri == NULL && priv->non_search_regex && !g_regex_match (priv->non_search_regex, url, 0, NULL)) { - char *query_param = soup_form_encode ("q", url, NULL); + char *query_param, *url_search; + + url_search = eel_gconf_get_string (CONF_URL_SEARCH); + + if (url_search == NULL || url_search[0] == '\0') { + g_free (url_search); + + url_search = g_strdup (_("http://www.google.com/search?q=%s&ie=UTF-8&oe=UTF-8")); + } + + query_param = soup_form_encode ("q", url, NULL); /* + 2 here is getting rid of 'q=' */ - effective_url = g_strdup_printf (_("http://www.google.com/search?q=%s&ie=UTF-8&oe=UTF-8"), query_param + 2); + effective_url = g_strdup_printf (url_search, query_param + 2); g_free (query_param); + g_free (url_search); } else effective_url = ephy_embed_utils_normalize_address (url); -- cgit v1.2.3