core: RelationalExpression keeps search caps
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Mon, 19 Jul 2010 16:31:24 +0000 (19:31 +0300)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Mon, 19 Jul 2010 17:47:32 +0000 (20:47 +0300)
Move static CSV list of properties supported in Search action from
ContentDirectory to RelationalExpression.

src/rygel/rygel-content-directory.vala
src/rygel/rygel-relational-expression.vala

index ba56f97..46c7edf 100644 (file)
@@ -48,9 +48,6 @@ public class Rygel.ContentDirectory: Service {
     public const string UPNP_TYPE_V1 =
                     "urn:schemas-upnp-org:service:ContentDirectory:1";
     public const string DESCRIPTION_PATH = "xml/ContentDirectory.xml";
-    private const string SEARCH_CAPS = "@id,@parentID,@refID," +
-                                       "upnp:class,dc:title,dc:creator," +
-                                       "res,res@protocolInfo";
 
     protected string feature_list;
     protected string sort_caps;
@@ -260,7 +257,7 @@ public class Rygel.ContentDirectory: Service {
     private void get_search_capabilities_cb (Service             content_dir,
                                              owned ServiceAction action) {
         /* Set action return arguments */
-        action.set ("SearchCaps", typeof (string), SEARCH_CAPS);
+        action.set ("SearchCaps", typeof (string), RelationalExpression.CAPS);
 
         action.return ();
     }
@@ -271,7 +268,7 @@ public class Rygel.ContentDirectory: Service {
                                             ref GLib.Value value) {
         /* Set action return arguments */
         value.init (typeof (string));
-        value.set_string (SEARCH_CAPS);
+        value.set_string (RelationalExpression.CAPS);
     }
 
     /* action GetSortCapabilities implementation */
index 9849524..7888ce8 100644 (file)
@@ -26,6 +26,10 @@ using GUPnP;
 // relational operator.
 public class Rygel.RelationalExpression :
              Rygel.SearchExpression<SearchCriteriaOp,string,string> {
+    internal const string CAPS = "@id,@parentID,@refID," +
+                                 "upnp:class,dc:title,dc:creator," +
+                                 "res,res@protocolInfo";
+
     public override bool satisfied_by (MediaObject media_object) {
         switch (this.operand1) {
         case "@id":