[tracker] tracker-search: Don't show "(null)" for nie:InformationElements with no nie:url



commit 78d2bf2d7f453be4c332b7c521de7f692bf8debb
Author: Martyn Russell <martyn lanedo com>
Date:   Fri Jun 27 08:51:50 2014 +0100

    tracker-search: Don't show "(null)" for nie:InformationElements with no nie:url

 src/tracker-utils/tracker-search.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/tracker-utils/tracker-search.c b/src/tracker-utils/tracker-search.c
index 2a4968a..9fd9846 100644
--- a/src/tracker-utils/tracker-search.c
+++ b/src/tracker-utils/tracker-search.c
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2009, Nokia <ivan frade nokia com>
+ * Copyright (C) 2014, SoftAtHome <contact softathome com>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -1292,9 +1293,10 @@ get_files (TrackerSparqlConnection *connection,
        fts = get_fts_string (search_terms, use_or_operator);
 
        if (fts) {
-               query = g_strdup_printf ("SELECT ?u nie:url(?u) "
+               query = g_strdup_printf ("SELECT ?u ?url"
                                         "WHERE { "
                                         "  ?u a nie:InformationElement ;"
+                                        "  ?url nie:url(?u) ;"
                                         "  fts:match \"%s\" ."
                                         "  %s"
                                         "} "
@@ -1306,9 +1308,10 @@ get_files (TrackerSparqlConnection *connection,
                                         search_offset,
                                         search_limit);
        } else {
-               query = g_strdup_printf ("SELECT ?u nie:url(?u) "
+               query = g_strdup_printf ("SELECT ?u ?url "
                                         "WHERE { "
-                                        "  ?u a nie:InformationElement ."
+                                        "  ?u a nie:InformationElement ;"
+                                        "     nie:url ?url ."
                                         "  %s"
                                         "} "
                                         "ORDER BY ASC(nie:url(?u)) "


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