[rygel] tracker: Adapt to changed KeyChainMap
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] tracker: Adapt to changed KeyChainMap
- Date: Wed, 22 Jun 2011 11:05:09 +0000 (UTC)
commit 53ec7cc54396121d3c505f656473608bfb3801ea
Author: Jens Georg <mail jensge org>
Date: Sat Jun 11 12:41:52 2011 +0200
tracker: Adapt to changed KeyChainMap
.../tracker/rygel-tracker-query-helper.vala | 8 +----
.../tracker/rygel-tracker-search-query.vala | 28 +++++++++----------
2 files changed, 15 insertions(+), 21 deletions(-)
---
diff --git a/src/plugins/tracker/rygel-tracker-query-helper.vala b/src/plugins/tracker/rygel-tracker-query-helper.vala
index 1be515a..caf1c7e 100644
--- a/src/plugins/tracker/rygel-tracker-query-helper.vala
+++ b/src/plugins/tracker/rygel-tracker-query-helper.vala
@@ -42,11 +42,7 @@ public class Rygel.Tracker.QueryHelper : Object {
uint max_count = 0,
Cancellable? cancellable) {
// Collect key chains
- var key_chains = new ArrayList<ArrayList<string>> ();
- var key_chain_map = KeyChainMap.get_key_chain_map ();
- foreach (var property in this.container.item_factory.properties) {
- key_chains.add (key_chain_map[property]);
- }
+ var properties = this.container.item_factory.properties;
// Collect triplets
var triplets = new QueryTriplets ();
@@ -59,7 +55,7 @@ public class Rygel.Tracker.QueryHelper : Object {
var filter = this.create_query_filter (expression);
// Create query
- var query = new SearchQuery (key_chains,
+ var query = new SearchQuery (properties,
triplets,
filter,
order_by,
diff --git a/src/plugins/tracker/rygel-tracker-search-query.vala b/src/plugins/tracker/rygel-tracker-search-query.vala
index 438bca0..150e8f2 100644
--- a/src/plugins/tracker/rygel-tracker-search-query.vala
+++ b/src/plugins/tracker/rygel-tracker-search-query.vala
@@ -39,7 +39,7 @@ public class Rygel.Tracker.SearchQuery : Query {
ITEM_VARIABLE +
") = true)";
- public ArrayList<ArrayList<string>> key_chains;
+ public ArrayList<string> properties;
public QueryFilter filter;
public string order_by;
public uint offset;
@@ -47,16 +47,16 @@ public class Rygel.Tracker.SearchQuery : Query {
public string[,] result;
- public SearchQuery (ArrayList<ArrayList<string>>? key_chains,
- QueryTriplets triplets,
- QueryFilter? filter,
- string? order_by = null,
- uint offset = 0,
- uint max_count = 0,
- Cancellable? cancellable) {
+ public SearchQuery (ArrayList<string> properties,
+ QueryTriplets triplets,
+ QueryFilter? filter,
+ string? order_by = null,
+ uint offset = 0,
+ uint max_count = 0,
+ Cancellable? cancellable) {
base (triplets);
- this.key_chains = key_chains;
+ this.properties = properties;
this.filter = filter;
this.order_by = order_by;
this.offset = offset;
@@ -93,12 +93,10 @@ public class Rygel.Tracker.SearchQuery : Query {
query += " COUNT(" + this.ITEM_VARIABLE + ")";
} else {
query += " " + this.ITEM_VARIABLE;
- foreach (var chain in this.key_chains) {
- var variable = this.ITEM_VARIABLE;
- foreach (var key in chain) {
- variable = key + "(" + variable + ")";
- }
- query += " " + variable;
+ var key_chain_map = KeyChainMap.get_key_chain_map ();
+
+ foreach (var propery in this.properties) {
+ query += key_chain_map.map_property (propery);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]