From 3ee034625ea487f0c17342fdf63a235ca62ea1a5 Mon Sep 17 00:00:00 2001 From: "Zeeshan Ali (Khattak)" Date: Thu, 12 Nov 2009 00:45:52 +0200 Subject: [PATCH] tracker: Complete RDF query when needed This is so that we can insert more conditions into the query if/when needed. --- .../tracker/rygel-tracker-metadata-values.vala | 10 ++++----- .../tracker/rygel-tracker-search-container.vala | 24 ++++++++++++++++++++-- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/plugins/tracker/rygel-tracker-metadata-values.vala b/src/plugins/tracker/rygel-tracker-metadata-values.vala index d492daa..a8fceb2 100644 --- a/src/plugins/tracker/rygel-tracker-metadata-values.vala +++ b/src/plugins/tracker/rygel-tracker-metadata-values.vala @@ -35,12 +35,10 @@ public class Rygel.TrackerMetadataValues : Rygel.SimpleContainer { private const string SERVICE = "Files"; private const string QUERY_CONDITION = - "\n" + - "\n" + - "\n" + - "%s\n" + - "\n" + - ""; + "\n" + + "\n" + + "%s\n" + + "\n"; public TrackerMetadataIface metadata; diff --git a/src/plugins/tracker/rygel-tracker-search-container.vala b/src/plugins/tracker/rygel-tracker-search-container.vala index ed9ff1f..c4cf361 100644 --- a/src/plugins/tracker/rygel-tracker-search-container.vala +++ b/src/plugins/tracker/rygel-tracker-search-container.vala @@ -73,13 +73,23 @@ public class Rygel.TrackerSearchContainer : Rygel.MediaContainer { // We are performing actual search (though an optimized one) to get // the hitcount rather than GetHitCount because GetHitCount only // allows us to get hit count for Text searches. + string query; + + if (this.query_condition != "") { + query = "\n" + + this.query_condition + + ""; + } else { + query = ""; + } + var search_result = yield this.search_proxy.query ( 0, this.service, new string[0], "", this.keywords, - this.query_condition, + query, false, new string[0], false, @@ -104,13 +114,23 @@ public class Rygel.TrackerSearchContainer : Rygel.MediaContainer { throws GLib.Error { string[] keys = TrackerItem.get_metadata_keys (); + string query; + + if (this.query_condition != "") { + query = "\n" + + this.query_condition + + ""; + } else { + query = ""; + } + var search_result = yield this.search_proxy.query ( 0, this.service, keys, "", this.keywords, - this.query_condition, + query, false, new string[0], false, -- 2.7.4