[nautilus] Perform case insensitive searches with tracker



commit ec36b6352c21eaf3e908a6da0d3991cd51707d8d
Author: William Jon McCann <jmccann redhat com>
Date:   Mon Jul 16 11:00:21 2012 -0400

    Perform case insensitive searches with tracker

 .../nautilus-search-engine-tracker.c               |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/libnautilus-private/nautilus-search-engine-tracker.c b/libnautilus-private/nautilus-search-engine-tracker.c
index 2704f6a..25413f5 100644
--- a/libnautilus-private/nautilus-search-engine-tracker.c
+++ b/libnautilus-private/nautilus-search-engine-tracker.c
@@ -172,7 +172,7 @@ static void
 nautilus_search_engine_tracker_start (NautilusSearchEngine *engine)
 {
 	NautilusSearchEngineTracker *tracker;
-	gchar	*search_text, *location_uri;
+	gchar	*query_text, *search_text, *location_uri;
 	GString *sparql;
 	GList *mimetypes, *l;
 	gint mime_count;
@@ -189,7 +189,10 @@ nautilus_search_engine_tracker_start (NautilusSearchEngine *engine)
 
 	g_cancellable_reset (tracker->details->cancellable);
 
-	search_text = nautilus_query_get_text (tracker->details->query);
+	query_text = nautilus_query_get_text (tracker->details->query);
+	search_text = g_utf8_strdown (query_text, -1);
+	g_free (query_text);
+
 	location_uri = nautilus_query_get_location (tracker->details->query);
 	mimetypes = nautilus_query_get_mime_types (tracker->details->query);
 
@@ -250,7 +253,7 @@ nautilus_search_engine_tracker_start (NautilusSearchEngine *engine)
 	}
 
 	g_string_append (sparql, "    tracker:available true ."
-			 "  FILTER (fn:contains(nfo:fileName(?urn),");
+			 "  FILTER (fn:contains(fn:lower-case(nfo:fileName(?urn)),");
 
 	sparql_append_string_literal (sparql, search_text);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]