[rygel] tracker: Complete RDF query when needed
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [rygel] tracker: Complete RDF query when needed
- Date: Mon, 16 Nov 2009 23:18:25 +0000 (UTC)
commit 3ee034625ea487f0c17342fdf63a235ca62ea1a5
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Thu Nov 12 00:45:52 2009 +0200
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 =
- "<rdfq:Condition>\n" +
- "<rdfq:equals>\n" +
- "<rdfq:Property name=\"%s\" />\n" +
- "<rdf:String>%s</rdf:String>\n" +
- "</rdfq:equals>\n" +
- "</rdfq:Condition>";
+ "<rdfq:equals>\n" +
+ "<rdfq:Property name=\"%s\" />\n" +
+ "<rdf:String>%s</rdf:String>\n" +
+ "</rdfq:equals>\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 = "<rdfq:Condition>\n" +
+ this.query_condition +
+ "</rdfq: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 = "<rdfq:Condition>\n" +
+ this.query_condition +
+ "</rdfq: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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]