Logging in to :pserver:anonymous@anoncvs.gnome.org:2401/cvs/gnome
Index: lib/ephy-autocompletion.h
===================================================================
RCS file: /cvs/gnome/epiphany/lib/ephy-autocompletion.h,v
retrieving revision 1.2
diff -u -r1.2 ephy-autocompletion.h
--- lib/ephy-autocompletion.h	26 Feb 2003 00:59:16 -0000	1.2
+++ lib/ephy-autocompletion.h	21 Jul 2003 13:09:16 -0000
@@ -68,8 +68,9 @@
 
 struct _EphyAutocompletionMatch
 {
-	const char *match;
+	char *match;
 	const char *title;
+	char *folded_title;
 	const char *target;
 	guint offset;
 	gint32 score;
Logging in to :pserver:anonymous@anoncvs.gnome.org:2401/cvs/gnome
Index: lib/ephy-autocompletion.c
===================================================================
RCS file: /cvs/gnome/epiphany/lib/ephy-autocompletion.c,v
retrieving revision 1.10
diff -u -r1.10 ephy-autocompletion.c
--- lib/ephy-autocompletion.c	23 Jun 2003 09:57:20 -0000	1.10
+++ lib/ephy-autocompletion.c	21 Jul 2003 13:09:51 -0000
@@ -314,10 +314,19 @@
 
 		if (mi->is_action ||
 		    (mi->match && mi->substring && g_strrstr (mi->match, p->keys[0])) ||
-		    (mi->title && mi->substring && g_strrstr (mi->title, p->keys[0])) ||
+		    (mi->folded_title && mi->substring && g_strrstr (mi->folded_title, p->keys[0])) ||
 		    !strncmp (key0, mi->title + mi->offset, key0l))
 		{
-			acma_append (&newmatches, mi, mi->is_action);
+			EphyAutocompletionMatch m;
+			m.match = g_strdup(mi->match);
+			m.title = mi->title;
+			m.folded_title = g_strdup(mi->folded_title);
+			m.target = mi->target;
+			m.is_action = mi->is_action;
+			m.substring = mi->substring;
+			m.offset = mi->offset;
+			m.score = mi->score;
+			acma_append (&newmatches, &m, m.is_action);
 		}
 		else
 		{
@@ -361,14 +370,28 @@
 					      guint32 score,
 					      EphyAutocompletionPrivate *p)
 {
+	gchar *folded_item = NULL;
+	gchar *folded_title = NULL;
+
+	if (item)
+	{
+		folded_item = g_utf8_casefold (item, -1);
+	}
+
+	if (title)
+	{
+		folded_title = g_utf8_casefold (title, -1);
+	}
+
 	if (substring)
 	{
-		if ((item && g_strrstr (item, p->keys[0])) ||
-		    (title && g_strrstr (title, p->keys[0])))
+		if ((item && g_strrstr (folded_item, p->keys[0])) ||
+		    (title && g_strrstr (folded_title, p->keys[0])))
 		{
 			EphyAutocompletionMatch m;
-			m.match = item;
+			m.match = folded_item;
 			m.title = title;
+			m.folded_title = folded_title;
 			m.target = target;
 			m.is_action = is_action;
 			m.substring = substring;
@@ -380,8 +403,9 @@
 	else if (is_action)
 	{
 		EphyAutocompletionMatch m;
-		m.match = item;
+		m.match = folded_item;
 		m.title = title;
+		m.folded_title = folded_title;
 		m.target = target;
 		m.is_action = is_action;
 		m.substring = substring;
@@ -394,11 +418,12 @@
 		guint i;
 		for (i = 0; p->keys[i]; ++i)
 		{
-			if (!strncmp (item, p->keys[i], p->key_lengths[i]))
+			if (!strncmp (folded_item, p->keys[i], p->key_lengths[i]))
 			{
 				EphyAutocompletionMatch m;
-				m.match = item;
+				m.match = folded_item;
 				m.title = title;
+				m.folded_title = folded_title;
 				m.target = target;
 				m.is_action = is_action;
 				m.substring = substring;
@@ -564,6 +589,22 @@
 static void
 acma_destroy (ACMatchArray *a)
 {
+	guint i;
+	for (i = 0; i < a->num_matches; i++)
+	{
+		EphyAutocompletionMatch *mi = &a->array[i];
+
+		if (mi->match)
+		{
+			g_free(mi->match);
+		}
+
+		if (mi->folded_title)
+		{
+			g_free(mi->folded_title);
+		}
+	}
+
 	g_free (a->array);
 	a->array = NULL;
 	a->array_size = 0;
Logging in to :pserver:anonymous@anoncvs.gnome.org:2401/cvs/gnome
Index: lib/widgets/ephy-location-entry.c
===================================================================
RCS file: /cvs/gnome/epiphany/lib/widgets/ephy-location-entry.c,v
retrieving revision 1.25
diff -u -r1.25 ephy-location-entry.c
--- lib/widgets/ephy-location-entry.c	7 Jul 2003 11:15:07 -0000	1.25
+++ lib/widgets/ephy-location-entry.c	21 Jul 2003 13:11:02 -0000
@@ -771,11 +771,14 @@
 		GtkEditable *editable = GTK_EDITABLE (p->entry);
 		gint sstart, send;
 		gchar *text;
+		gchar *folded_text;
 		gtk_editable_get_selection_bounds (editable, &sstart, &send);
 		text = gtk_editable_get_chars (editable, 0, sstart);
-		ephy_autocompletion_set_key (p->autocompletion, text);
+		folded_text = g_utf8_casefold(text, -1);
+		g_free(text);
+		ephy_autocompletion_set_key (p->autocompletion, folded_text);
 		g_free (p->autocompletion_key);
-		p->autocompletion_key = text;
+		p->autocompletion_key = folded_text;
 	}
 }
 
