]> spindle.queued.net Git - midori/commitdiff
Back to case folding and handling completion actions properly
authorChristian Dywan <christian@twotoasts.de>
Mon, 23 Nov 2009 19:41:10 +0000 (20:41 +0100)
committerChristian Dywan <christian@twotoasts.de>
Mon, 23 Nov 2009 19:41:10 +0000 (20:41 +0100)
midori/midori-locationaction.c

index 16057cad05d7b3615eea94336e49987ec550cf4b..6c06a0e2d57d421d02fb96030c923524fbd7fa43 100644 (file)
@@ -742,11 +742,20 @@ midori_location_entry_completion_match_cb (GtkEntryCompletion* completion,
     match = FALSE;
     if (G_LIKELY (uri))
     {
-        match = strstr (uri, key) != NULL;
+        gchar* fkey = g_utf8_casefold (key, -1);
+        gchar* furi = g_utf8_casefold (uri, -1);
         g_free (uri);
+        match = strstr (furi, fkey) != NULL;
+        g_free (furi);
 
         if (!match && G_LIKELY (title))
-            match = strstr (title, key) != NULL;
+        {
+            gchar* ftitle = g_utf8_casefold (title, -1);
+            match = strstr (ftitle, fkey) != NULL;
+            g_free (ftitle);
+        }
+
+        g_free (fkey);
     }
 
     g_free (title);
@@ -1414,11 +1423,10 @@ midori_location_action_set_search_engines (MidoriLocationAction* location_action
         completion = gtk_entry_get_completion (GTK_ENTRY (child));
         i = 0;
         if (location_action->search_engines)
-        {
             while ((item = katze_array_get_nth_item (location_action->search_engines, i++)))
                 gtk_entry_completion_delete_action (completion, 0);
-            midori_location_action_add_actions (completion, search_engines);
-        }
+
+        midori_location_action_add_actions (completion, search_engines);
     }
 
     katze_object_assign (location_action->search_engines, search_engines);