Do address matches with a simple strstr for now

The way we originally folded strings didn't work in all cases of
unicode strings and the last attempt to improve that broke it
on some systems while it improved on others.
So for now we go back to the safe way.
This commit is contained in:
Christian Dywan 2009-11-21 20:09:07 +01:00
parent 818b6a990d
commit a38574473f

View file

@ -735,8 +735,6 @@ midori_location_entry_completion_match_cb (GtkEntryCompletion* completion,
gchar* uri; gchar* uri;
gchar* title; gchar* title;
gboolean match; gboolean match;
gchar* temp;
gchar* ftemp;
model = gtk_entry_completion_get_model (completion); model = gtk_entry_completion_get_model (completion);
gtk_tree_model_get (model, iter, URI_COL, &uri, TITLE_COL, &title, -1); gtk_tree_model_get (model, iter, URI_COL, &uri, TITLE_COL, &title, -1);
@ -744,25 +742,11 @@ midori_location_entry_completion_match_cb (GtkEntryCompletion* completion,
match = FALSE; match = FALSE;
if (G_LIKELY (uri)) if (G_LIKELY (uri))
{ {
gchar* ckey = g_utf8_collate_key (key, -1); match = strstr (uri, key) != NULL;
gchar* fkey = g_utf8_casefold (ckey, -1);
g_free (ckey);
temp = g_utf8_collate_key (uri, -1);
ftemp = g_utf8_casefold (temp, -1);
g_free (temp);
match = (strstr (ftemp, fkey) != NULL);
g_free (ftemp);
g_free (uri); g_free (uri);
if (!match && G_LIKELY (title)) if (!match && G_LIKELY (title))
{ match = strstr (title, key) != NULL;
temp = g_utf8_collate_key (title, -1);
ftemp = g_utf8_casefold (temp, -1);
g_free (temp);
match = (strstr (ftemp, fkey) != NULL);
g_free (ftemp);
}
g_free (fkey);
} }
g_free (title); g_free (title);