tracker: Improved handling of search by "upnp:class"
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Tue, 28 Sep 2010 13:37:40 +0000 (16:37 +0300)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Tue, 28 Sep 2010 13:54:50 +0000 (16:54 +0300)
SearchContainer maps search for "upnp:class" to all its children if
"upnp:class" in question is that of its item factory.

src/plugins/tracker/rygel-tracker-search-container.vala

index ef71a4e..c94de34 100644 (file)
@@ -198,7 +198,7 @@ public class Rygel.Tracker.SearchContainer : Rygel.MediaContainer {
                                           int                   offset,
                                           int                   max_count) {
         if (expression.operand1 == "upnp:class" &&
-            expression.operand2.has_prefix (MediaContainer.UPNP_CLASS)) {
+            !this.item_factory.upnp_class.has_prefix (expression.operand2)) {
             return null;
         }
 
@@ -208,7 +208,7 @@ public class Rygel.Tracker.SearchContainer : Rygel.MediaContainer {
             if (!expression.compare_string (this.id)) {
                 return null;
             }
-        } else {
+        } else if (expression.operand1 != "upnp:class") {
             var filter = create_filter_for_child (expression);
             if (filter != null) {
                 query.filters.insert (0, filter);