[rygel] core: Support search by 'upnp:CreateClass'



commit 24ef816afd4638e8c42020df4bb3b943be58ed8c
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Mon Jun 21 18:22:24 2010 +0300

    core: Support search by 'upnp:CreateClass'

 src/rygel/rygel-relational-expression.vala |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/src/rygel/rygel-relational-expression.vala b/src/rygel/rygel-relational-expression.vala
index eebf646..9849524 100644
--- a/src/rygel/rygel-relational-expression.vala
+++ b/src/rygel/rygel-relational-expression.vala
@@ -38,6 +38,13 @@ public class Rygel.RelationalExpression :
             return this.compare_string (media_object.upnp_class);
         case "dc:title":
             return this.compare_string (media_object.title);
+        case "upnp:createClass":
+            if (!(media_object is MediaContainer)) {
+                return false;
+            }
+
+            var container = media_object as MediaContainer;
+            return this.compare_create_class (container);
         case "dc:creator":
             if (!(media_object is MediaItem)) {
                 return false;
@@ -58,6 +65,20 @@ public class Rygel.RelationalExpression :
         return "%s %d %s".printf (this.operand1, this.op, this.operand2);
     }
 
+    private bool compare_create_class (MediaContainer container) {
+        var ret = false;
+
+        foreach (var create_class in container.create_classes) {
+            if (this.compare_string (create_class)) {
+                ret = true;
+
+                break;
+            }
+        }
+
+        return ret;
+    }
+
     private bool compare_resource (MediaObject media_object) {
         bool ret = false;
 



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