external: Container ID isn't always its path
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Wed, 21 Jul 2010 00:13:12 +0000 (03:13 +0300)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Wed, 21 Jul 2010 00:38:02 +0000 (03:38 +0300)
An exception to this rule is the root container where its ID is "0" but
thats not its path.

src/plugins/external/rygel-external-container.vala
src/plugins/external/rygel-external-content-dir.vala

index 879bcb8..5675c85 100644 (file)
@@ -47,6 +47,7 @@ public class Rygel.External.Container : Rygel.MediaContainer {
                       uint       child_count,
                       bool       searchable,
                       string     service_name,
+                      string     path,
                       string     host_ip,
                       Container? parent = null) {
         base (id, parent, title, (int) child_count);
@@ -64,7 +65,7 @@ public class Rygel.External.Container : Rygel.MediaContainer {
 
         // Create proxy to MediaContainer iface
         this.actual_container = this.connection.get_object (this.service_name,
-                                                            id)
+                                                            path)
                                 as MediaContainerProxy;
 
         this.update_container.begin (true);
@@ -256,16 +257,17 @@ public class Rygel.External.Container : Rygel.MediaContainer {
         this.containers.clear ();
 
         foreach (var props in children_props) {
-            var id = props.lookup ("Path").get_string ();
+            var path = props.lookup ("Path").get_string ();
             var title = props.lookup ("DisplayName").get_string ();
             var child_count = props.lookup ("ChildCount").get_uint ();
             var searchable = props.lookup ("Searchable").get_boolean ();
 
-            var container = new Container (id,
+            var container = new Container (path,
                                            title,
                                            child_count,
                                            searchable,
                                            this.service_name,
+                                           path,
                                            this.host_ip,
                                            this);
             this.containers.add (container);
index ae80745..98b5031 100644 (file)
@@ -39,6 +39,7 @@ public class Rygel.External.ContentDir : Rygel.ContentDirectory {
                               plugin.child_count,
                               plugin.searchable,
                               plugin.service_name,
+                              plugin.root_object,
                               this.context.host_ip,
                               null);
     }