From bab5408235121f4e6be6b348e6a703af97370405 Mon Sep 17 00:00:00 2001 From: "Zeeshan Ali (Khattak)" Date: Mon, 16 Nov 2009 20:15:39 +0200 Subject: [PATCH] tracker: get_children() now based on search() TrackerSearchContainer.get_children() now based on search() and therefore much simpler. --- .../tracker/rygel-tracker-search-container.vala | 45 +++++----------------- 1 file changed, 10 insertions(+), 35 deletions(-) diff --git a/src/plugins/tracker/rygel-tracker-search-container.vala b/src/plugins/tracker/rygel-tracker-search-container.vala index 88ff573..7221f3d 100644 --- a/src/plugins/tracker/rygel-tracker-search-container.vala +++ b/src/plugins/tracker/rygel-tracker-search-container.vala @@ -111,43 +111,18 @@ public class Rygel.TrackerSearchContainer : Rygel.MediaContainer { uint max_count, Cancellable? cancellable) 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, - query, - false, - new string[0], - false, - (int) offset, - (int) max_count); - - var children = new ArrayList (); - /* Iterate through all items */ - for (uint i = 0; i < search_result.length[0]; i++) { - string path = search_result[i, 0]; - string service = search_result[i, 1]; - string[] metadata = this.slice_strvv_tail (search_result, i, 2); + var expression = new RelationalExpression (); + expression.op = SearchCriteriaOp.EQ; + expression.operand1 = "@parentID"; + expression.operand2 = this.id; - var item = this.create_item (service, path, metadata); - children.add (item); - } + uint total_matches; - return children; + return yield this.search (expression, + offset, + max_count, + out total_matches, + cancellable); } public override async Gee.List? search ( -- 2.7.4