From: Zeeshan Ali (Khattak) Date: Mon, 16 Feb 2009 17:33:11 +0000 (+0000) Subject: Basic skeleton for "ContainerUpdateIDs" state-variable. X-Git-Tag: RYGEL_0_2_2~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9ee2a77381c7e9a5506399330d0e13126d6ee2db;p=profile%2Fivi%2Frygel.git Basic skeleton for "ContainerUpdateIDs" state-variable. svn path=/trunk/; revision=609 --- diff --git a/data/xml/ContentDirectory.xml b/data/xml/ContentDirectory.xml index 46174e8..fa001bb 100644 --- a/data/xml/ContentDirectory.xml +++ b/data/xml/ContentDirectory.xml @@ -33,6 +33,13 @@ feature provided by your editor. + + ContainerUpdateIDs + yes + string + + + FeatureList no string @@ -107,13 +114,6 @@ feature provided by your editor. - ContainerUpdateIDs - yes - string - - - - TransferIDs yes string diff --git a/src/rygel/rygel-content-directory.vala b/src/rygel/rygel-content-directory.vala index e120ead..7dad825 100644 --- a/src/rygel/rygel-content-directory.vala +++ b/src/rygel/rygel-content-directory.vala @@ -51,6 +51,7 @@ public class Rygel.ContentDirectory: Service { protected HTTPServer http_server; public MediaContainer root_container; + private ArrayList updated_containers; private ArrayList browses; public uint32 system_update_id; @@ -65,6 +66,7 @@ public class Rygel.ContentDirectory: Service { this.http_server = new HTTPServer (this, this.get_type ().name ()); this.browses = new ArrayList (); + this.updated_containers = new ArrayList (); this.feature_list = "" + @@ -82,6 +84,8 @@ public class Rygel.ContentDirectory: Service { this.action_invoked["GetSystemUpdateID"] += this.get_system_update_id_cb; this.query_variable["SystemUpdateID"] += this.query_system_update_id; + this.query_variable["ContainerUpdateIDs"] += + this.query_container_update_ids; /* Connect SearchCapabilities related signals */ this.action_invoked["GetSearchCapabilities"] += @@ -133,6 +137,17 @@ public class Rygel.ContentDirectory: Service { value.set_uint (this.system_update_id); } + /* Query ContainerUpdateIDs */ + private void query_container_update_ids (ContentDirectory content_dir, + string variable, + ref GLib.Value value) { + var update_ids = this.create_container_update_ids (); + + /* Set action return arguments */ + value.init (typeof (string)); + value.set_string (update_ids); + } + /* action GetSearchCapabilities implementation */ private void get_search_capabilities_cb (ContentDirectory content_dir, owned ServiceAction action) { @@ -190,5 +205,16 @@ public class Rygel.ContentDirectory: Service { private void on_browse_completed (Browse browse) { this.browses.remove (browse); } + + private string create_container_update_ids () { + var update_ids = ""; + + foreach (var container in this.updated_containers) { + update_ids += "," + container.id + "," + + container.update_id.to_string (); + } + + return update_ids; + } }