[nautilus] search-engine-tracker: Fix query when no location is specified



commit 11b05d9a53d78008538c3ad85fe2ae59b0903ebf
Author: Florian MÃllner <fmuellner gnome org>
Date:   Sat Sep 1 02:50:44 2012 +0200

    search-engine-tracker: Fix query when no location is specified
    
    Although the location_uri is optional for queries, the generated
    sparql query is invalid if it is missing; fix by moving the
    concatenation operator into the optional part.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=683480

 .../nautilus-search-engine-tracker.c               |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/libnautilus-private/nautilus-search-engine-tracker.c b/libnautilus-private/nautilus-search-engine-tracker.c
index 013f359..8abfbe6 100644
--- a/libnautilus-private/nautilus-search-engine-tracker.c
+++ b/libnautilus-private/nautilus-search-engine-tracker.c
@@ -255,11 +255,11 @@ nautilus_search_engine_tracker_start (NautilusSearchProvider *provider)
 	g_string_append (sparql, " . FILTER (");
 	
 	if (location_uri)  {
-		g_string_append_printf (sparql, " fn:starts-with(nie:url(?urn), '%s')",
+		g_string_append_printf (sparql, " fn:starts-with(nie:url(?urn), '%s') && ",
 					location_uri);
 	}
 
-	g_string_append_printf (sparql, " && fn:contains(fn:lower-case(nfo:fileName(?urn)), '%s')",
+	g_string_append_printf (sparql, "fn:contains(fn:lower-case(nfo:fileName(?urn)), '%s')",
 				search_text);
 
 	if (mime_count > 0) {



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