[Xfce4-commits] <midori:master> Allow search engine addresses prefixed with %s

Christian Dywan noreply at xfce.org
Thu Jan 5 00:02:01 CET 2012


Updating branch refs/heads/master
         to 451cd1fbeafa49f52914f2e539c9619b6e0b34d4 (commit)
       from 64d21c21204c6046c1cd01f66aaad0167395c37d (commit)

commit 451cd1fbeafa49f52914f2e539c9619b6e0b34d4
Author: Christian Dywan <christian at twotoasts.de>
Date:   Wed Jan 4 23:49:17 2012 +0100

    Allow search engine addresses prefixed with %s
    
    Related to: https://bugs.launchpad.net/midori/+bug/909423

 katze/katze-utils.c          |    2 ++
 midori/midori-searchaction.c |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/katze/katze-utils.c b/katze/katze-utils.c
index ac9df02..c49d4df 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 0042581..39ef35b 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)


More information about the Xfce4-commits mailing list