Allow search engine addresses prefixed with %s

Related to: https://bugs.launchpad.net/midori/+bug/909423
This commit is contained in:
Christian Dywan 2012-01-04 23:49:17 +01:00
parent 64d21c2120
commit 451cd1fbea
2 changed files with 3 additions and 0 deletions

View file

@ -1520,6 +1520,8 @@ katze_uri_entry_changed_cb (GtkWidget* entry,
{ {
const gchar* uri = gtk_entry_get_text (GTK_ENTRY (entry)); const gchar* uri = gtk_entry_get_text (GTK_ENTRY (entry));
gboolean valid = midori_uri_is_location (uri); 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) if (*uri && !valid)
{ {
GdkColor bg_color = { 0 }; GdkColor bg_color = { 0 };

View file

@ -972,6 +972,7 @@ midori_search_action_get_editor (MidoriSearchAction* search_action,
#else #else
NULL); NULL);
#endif #endif
g_object_set_data (G_OBJECT (entry_uri), "allow_%s", (void*)1);
gtk_entry_set_activates_default (GTK_ENTRY (entry_uri), TRUE); gtk_entry_set_activates_default (GTK_ENTRY (entry_uri), TRUE);
if (!new_engine) if (!new_engine)
gtk_entry_set_text (GTK_ENTRY (entry_uri) gtk_entry_set_text (GTK_ENTRY (entry_uri)