[gtk+] gtksearchenginetracker: Use non-case sensitive search for non-fts search
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gtksearchenginetracker: Use non-case sensitive search for non-fts search
- Date: Mon, 6 Jun 2011 15:40:07 +0000 (UTC)
commit 288df3d0165ea109cecbdb148a4d134ad0779754
Author: Vincent Untz <vuntz gnome org>
Date: Sat Feb 19 19:08:10 2011 +0100
gtksearchenginetracker: Use non-case sensitive search for non-fts search
https://bugzilla.gnome.org/show_bug.cgi?id=642773
gtk/gtksearchenginetracker.c | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtksearchenginetracker.c b/gtk/gtksearchenginetracker.c
index c368b27..51f1b9a 100644
--- a/gtk/gtksearchenginetracker.c
+++ b/gtk/gtksearchenginetracker.c
@@ -301,6 +301,18 @@ sparql_append_string_literal (GString *sparql,
}
static void
+sparql_append_string_literal_lower_case (GString *sparql,
+ const gchar *str)
+{
+ gchar *s;
+
+ s = g_utf8_strdown (str, -1);
+ sparql_append_string_literal (sparql, s);
+
+ g_free (s);
+}
+
+static void
gtk_search_engine_tracker_start (GtkSearchEngine *engine)
{
GtkSearchEngineTracker *tracker;
@@ -350,8 +362,8 @@ gtk_search_engine_tracker_start (GtkSearchEngine *engine)
"WHERE {"
" ?urn a nfo:FileDataObject ;"
" tracker:available true ."
- " FILTER (fn:contains(nfo:fileName(?urn),");
- sparql_append_string_literal (sparql, search_text);
+ " FILTER (fn:contains(fn:lower-case(nfo:fileName(?urn)),");
+ sparql_append_string_literal_lower_case (sparql, search_text);
g_string_append (sparql,
"))"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]