From d8546ca689af185a456ec1f394bb89926d7c142a Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sat, 12 Oct 2019 12:16:26 +0200 Subject: Add a generic item for a custom search option (#351) In the case where a search engine was manually added to the config file or provided through distro defaults, the combo will display the hostname. Fixes: #211 --- core/preferences.vala | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'core') diff --git a/core/preferences.vala b/core/preferences.vala index faa65c98..0d7f0f1b 100644 --- a/core/preferences.vala +++ b/core/preferences.vala @@ -115,6 +115,12 @@ namespace Midori { combo.append ("http://search.yahoo.com/search?p=", "Yahoo"); combo.append ("http://www.google.com/search?q=%s", "Google"); settings.bind_property ("location-entry-search", combo, "active-id", BindingFlags.SYNC_CREATE | BindingFlags.BIDIRECTIONAL); + // Generic item for custom search option + if (combo.get_active_text () == null) { + string hostname = new Soup.URI (settings.location_entry_search).host; + combo.append (settings.location_entry_search, hostname); + combo.active_id = settings.location_entry_search; + } box.add (combo); box.show_all (); add (_("Browsing"), box); -- cgit v1.2.1