[rygel] tracker: Use new query classes in CategoryAllContainer



commit f640fd2e3b7def1a921c81035d38d471225d28d1
Author: Sunil Mohan Adapa <sunil medhas org>
Date:   Thu Dec 9 01:38:44 2010 +0530

    tracker: Use new query classes in CategoryAllContainer

 .../rygel-tracker-category-all-container.vala      |   25 ++++++++++++++-----
 1 files changed, 18 insertions(+), 7 deletions(-)
---
diff --git a/src/plugins/tracker/rygel-tracker-category-all-container.vala b/src/plugins/tracker/rygel-tracker-category-all-container.vala
index d848939..bdabd58 100644
--- a/src/plugins/tracker/rygel-tracker-category-all-container.vala
+++ b/src/plugins/tracker/rygel-tracker-category-all-container.vala
@@ -1,9 +1,11 @@
 /*
  * Copyright (C) 2008 Zeeshan Ali <zeenix gmail com>.
  * Copyright (C) 2008-2010 Nokia Corporation.
+ * Copyright (C) 2010 MediaNet Inh.
  *
- * Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
- *                               <zeeshan ali nokia com>
+ * Authors: Zeeshan Ali (Khattak) <zeeshanak gnome org>
+ *                                <zeeshan ali nokia com>
+ *          Sunil Mohan Adapa <sunil medhas org>
  *
  * This file is part of Rygel.
  *
@@ -37,11 +39,14 @@ public class Rygel.Tracker.CategoryAllContainer : SearchContainer,
     public ArrayList<string> create_classes { get; set; }
     public ArrayList<string> search_classes { get; set; }
 
+    private QueryHelper query_helper;
     private ResourcesIface resources;
 
     public CategoryAllContainer (CategoryContainer parent) {
         base ("All" + parent.id, parent, "All", parent.item_factory);
 
+        this.query_helper = new QueryHelper (this);
+
         this.create_classes = new ArrayList<string> ();
         this.create_classes.add (item_factory.upnp_class);
         this.search_classes = new ArrayList<string> ();
@@ -99,11 +104,17 @@ public class Rygel.Tracker.CategoryAllContainer : SearchContainer,
                                        out uint          total_matches,
                                        Cancellable?      cancellable)
                                        throws Error {
-        return yield this.simple_search (expression,
-                                         offset,
-                                         max_count,
-                                         out total_matches,
-                                         cancellable);
+        var query = this.query_helper.create_query (expression,
+                                                    null,
+                                                    offset,
+                                                    max_count,
+                                                    cancellable);
+
+        yield query.execute (this.resources);
+
+        total_matches = yield query.get_count (this.resources);
+
+        return this.query_helper.get_results (query);
     }
 
     private void on_graph_updated (DBusConnection connection,



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