[tracker] tracker-search-bar: Support listing tags



commit 8303bc746e0cfb9f34baafef72297184ec5642f7
Author: Martyn Russell <martyn lanedo com>
Date:   Tue Dec 1 10:50:59 2009 +0200

    tracker-search-bar: Support listing tags

 src/tracker-search-bar/tracker-results-window.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/tracker-search-bar/tracker-results-window.c b/src/tracker-search-bar/tracker-results-window.c
index 119010e..446080c 100644
--- a/src/tracker-search-bar/tracker-results-window.c
+++ b/src/tracker-search-bar/tracker-results-window.c
@@ -43,6 +43,7 @@
 #define DOCUMENT_QUERY "SELECT ?urn ?title ?belongs fts:rank(?urn) WHERE { ?urn a nfo:Document ; nfo:fileName ?title ; nfo:belongsToContainer ?belongs . ?urn fts:match \"%s*\" } ORDER BY DESC(fts:rank(?urn)) OFFSET 0 LIMIT %d"
 #define FOLDER_QUERY   "SELECT ?urn ?title ?belongs fts:rank(?urn) WHERE { ?urn a nfo:Folder ; nfo:fileName ?title ; nfo:belongsToContainer ?belongs . ?urn fts:match \"%s*\" } ORDER BY DESC(fts:rank(?urn)) OFFSET 0 LIMIT %d"
 #define APP_QUERY      "SELECT ?urn ?title WHERE { ?urn a nfo:Software ; nie:title ?title . FILTER regex (?title, \"%s\", \"i\") } ORDER BY DESC(?title) OFFSET 0 LIMIT %d"
+#define TAGS_QUERY     "SELECT ?urn ?title WHERE { ?urn a nao:Tag ; nao:prefLabel ?title . FILTER regex (?title, \"%s\", \"i\") } ORDER BY DESC(?title) OFFSET 0 LIMIT %d"
 
 #define GENERAL_SEARCH  "SELECT ?s ?type ?title WHERE { ?s fts:match \"%s*\" ; rdf:type ?type . OPTIONAL { ?s nie:title ?title } } OFFSET %d LIMIT %d"
 
@@ -1084,6 +1085,9 @@ search_get (TrackerResultsWindow *window,
 	case CATEGORY_APPLICATION:
 		format = APP_QUERY;
 		break;
+	case CATEGORY_TAG:
+		format = TAGS_QUERY;
+		break;
 	default:
 		format = NULL;
 		break;
@@ -1136,6 +1140,7 @@ search_start (TrackerResultsWindow *window)
 	search_get (window, CATEGORY_DOCUMENT);
 	search_get (window, CATEGORY_FOLDER);
 	search_get (window, CATEGORY_APPLICATION);
+	search_get (window, CATEGORY_TAG);
 }
 
 static gboolean



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