Commit 7e96228e authored by Michael Catanzaro's avatar Michael Catanzaro

Add setting to disable autosearch

On some intranets, it's important to be able to load domains with no
dot, e.g. example/something. But currently this triggers a web search if
the protocol is not explicitly specified, e.g. http://example/something.
Some users would rather disable autosearch rather than have to type out
http:// all the time, so add a hidden setting to cater to them.

https://bugzilla.gnome.org/show_bug.cgi?id=789776
parent 4f94f86b
......@@ -230,6 +230,10 @@
<key type="d" name="default-zoom-level">
<default>1.0</default>
<summary>Default zoom level for new pages</summary>
<key type="b" name="enable-autosearch">
<default>true</default>
<summary>Enable autosearch</summary>
<description>Whether to automatically search the web when something that does not look like a URL is entered in the address bar. If this setting is disabled, everything will be loaded as a URL unless a search engine is explicitly selected from the dropdown menu.</description>
</key>
</schema>
<schema id="org.gnome.Epiphany.state">
......
......@@ -25,6 +25,7 @@
#include "ephy-embed-utils.h"
#include "ephy-about-handler.h"
#include "ephy-prefs.h"
#include "ephy-settings.h"
#include "ephy-string.h"
......@@ -276,6 +277,9 @@ ephy_embed_utils_autosearch_address (const char *search_key)
EphyEmbedShell *shell;
EphySearchEngineManager *search_engine_manager;
if (!g_settings_get_boolean (EPHY_SETTINGS_WEB, EPHY_PREFS_WEB_ENABLE_AUTOSEARCH))
return g_strdup (search_key);
shell = ephy_embed_shell_get_default ();
search_engine_manager = ephy_embed_shell_get_search_engine_manager (shell);
address_search = ephy_search_engine_manager_get_default_search_address (search_engine_manager);
......
......@@ -101,7 +101,11 @@ static const char * const ephy_prefs_state_schema[] = {
#define EPHY_PREFS_WEB_ENABLE_SITE_SPECIFIC_QUIRKS "enable-site-specific-quirks"
#define EPHY_PREFS_WEB_ENABLE_SAFE_BROWSING "enable-safe-browsing"
#define EPHY_PREFS_WEB_GSB_API_KEY "gsb-api-key"
<<<<<<< HEAD
#define EPHY_PREFS_WEB_DEFAULT_ZOOM_LEVEL "default-zoom-level"
=======
#define EPHY_PREFS_WEB_ENABLE_AUTOSEARCH "enable-autosearch"
>>>>>>> Add setting to disable autosearch
static const char * const ephy_prefs_web_schema[] = {
EPHY_PREFS_WEB_FONT_MIN_SIZE,
......@@ -126,7 +130,8 @@ static const char * const ephy_prefs_web_schema[] = {
EPHY_PREFS_WEB_ENABLE_SITE_SPECIFIC_QUIRKS,
EPHY_PREFS_WEB_ENABLE_SAFE_BROWSING,
EPHY_PREFS_WEB_GSB_API_KEY,
EPHY_PREFS_WEB_DEFAULT_ZOOM_LEVEL
EPHY_PREFS_WEB_DEFAULT_ZOOM_LEVEL,
EPHY_PREFS_WEB_ENABLE_AUTOSEARCH
};
#define EPHY_PREFS_SCHEMA "org.gnome.Epiphany"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment