[Xfce4-commits] <midori:master> No completion when typing token or leading space

Christian Dywan noreply at xfce.org
Thu Oct 27 19:36:01 CEST 2011


Updating branch refs/heads/master
         to 9937abe3fc6f094da5d0b2fca03327ab40ba9b6f (commit)
       from 2a03ba5b5baf2ebc81c5e5305168ab82c10c2ad3 (commit)

commit 9937abe3fc6f094da5d0b2fca03327ab40ba9b6f
Author: Christian Dywan <christian at twotoasts.de>
Date:   Thu Oct 27 19:26:45 2011 +0200

    No completion when typing token or leading space

 midori/midori-locationaction.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c
index 0fc0374..5d9b6ee 100644
--- a/midori/midori-locationaction.c
+++ b/midori/midori-locationaction.c
@@ -356,7 +356,22 @@ midori_location_action_popup_timeout_cb (gpointer data)
     if (!action->entry || !gtk_widget_has_focus (action->entry) || !action->history)
         return FALSE;
 
-    if (!(action->key && *action->key))
+    /* No completion when typing a search token */
+    if (action->search_engines != NULL)
+    {
+        gchar** parts = g_strsplit (action->key, " ", 2);
+        if (parts && *parts && parts[1]
+                  && katze_array_find_token (action->search_engines, *parts))
+        {
+            g_strfreev (parts);
+            midori_location_action_popdown_completion (action);
+            return FALSE;
+        }
+        g_strfreev (parts);
+    }
+
+    /* Empaty string or starting with a space means: no completion */
+    if (!(action->key && *action->key && *action->key != ' '))
     {
         midori_location_action_popdown_completion (action);
         return FALSE;


More information about the Xfce4-commits mailing list