From: Christian Dywan Date: Wed, 4 Jan 2012 22:49:17 +0000 (+0100) Subject: Allow search engine addresses prefixed with %s X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=451cd1fbeafa49f52914f2e539c9619b6e0b34d4;p=midori Allow search engine addresses prefixed with %s Related to: https://bugs.launchpad.net/midori/+bug/909423 --- diff --git a/katze/katze-utils.c b/katze/katze-utils.c index ac9df02d..c49d4df9 100644 --- a/katze/katze-utils.c +++ b/katze/katze-utils.c @@ -1520,6 +1520,8 @@ katze_uri_entry_changed_cb (GtkWidget* entry, { const gchar* uri = gtk_entry_get_text (GTK_ENTRY (entry)); gboolean valid = midori_uri_is_location (uri); + if (!valid && g_object_get_data (G_OBJECT (entry), "allow_%s")) + valid = uri && g_str_has_prefix (uri, "%s"); if (*uri && !valid) { GdkColor bg_color = { 0 }; diff --git a/midori/midori-searchaction.c b/midori/midori-searchaction.c index 00425812..39ef35be 100644 --- a/midori/midori-searchaction.c +++ b/midori/midori-searchaction.c @@ -972,6 +972,7 @@ midori_search_action_get_editor (MidoriSearchAction* search_action, #else NULL); #endif + g_object_set_data (G_OBJECT (entry_uri), "allow_%s", (void*)1); gtk_entry_set_activates_default (GTK_ENTRY (entry_uri), TRUE); if (!new_engine) gtk_entry_set_text (GTK_ENTRY (entry_uri)