tracker: Use filters to make search query specific
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Thu, 3 Dec 2009 17:07:56 +0000 (19:07 +0200)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Thu, 3 Dec 2009 17:12:03 +0000 (19:12 +0200)
src/plugins/tracker/rygel-tracker-metadata-values.vala

index cad91b8..c3efc4e 100644 (file)
@@ -137,16 +137,20 @@ public class Rygel.TrackerMetadataValues : Rygel.SimpleContainer {
             var title = this.title_func (value);
 
             // The child container can use the same mandatory triplets we used
-            // in our query except that last value is now fixed
+            // in our query.
             var child_mandatory = new TrackerQueryTriplets.clone (mandatory);
-            child_mandatory.last ().obj = "\"" + value + "\"";
+
+            // However we constrain the object of our last mandatory triplet.
+            var filters = new ArrayList<string> ();
+            var filter = child_mandatory.last ().obj +  " = \"" + value + "\"";
+            filters.add (filter);
 
             var container = new TrackerSearchContainer (value,
                                                         this,
                                                         title,
                                                         this.item_factory,
                                                         child_mandatory,
-                                                        null);
+                                                        filters);
 
             this.add_child (container);
         }