[rygel] No need to pass service_name to ExternalItem



commit 422161ad796a7fb900b93335020d684ba4e8c16f
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Mon May 11 18:26:24 2009 +0300

    No need to pass service_name to ExternalItem
    
    Just make the service_name in ExternContainer public so child items can
    access it directly.
---
 src/plugins/external/rygel-external-container.vala |    5 ++---
 src/plugins/external/rygel-external-item.vala      |    5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/plugins/external/rygel-external-container.vala b/src/plugins/external/rygel-external-container.vala
index f4c31a1..4ce9ccc 100644
--- a/src/plugins/external/rygel-external-container.vala
+++ b/src/plugins/external/rygel-external-container.vala
@@ -41,7 +41,7 @@ public class Rygel.ExternalContainer : MediaContainer {
 
     public string host_ip;
 
-    private string service_name;
+    public string service_name;
     private string object_path;
 
     private ArrayList<MediaObject> media_objects;
@@ -157,8 +157,7 @@ public class Rygel.ExternalContainer : MediaContainer {
 
         object_paths = this.actual_container.GetItems ();
         foreach (var object_path in object_paths) {
-            this.media_objects.add (new ExternalItem (this.service_name,
-                                                      (string) object_path,
+            this.media_objects.add (new ExternalItem ((string) object_path,
                                                       this));
         }
 
diff --git a/src/plugins/external/rygel-external-item.vala b/src/plugins/external/rygel-external-item.vala
index 096dd73..affd60f 100644
--- a/src/plugins/external/rygel-external-item.vala
+++ b/src/plugins/external/rygel-external-item.vala
@@ -34,8 +34,7 @@ public class Rygel.ExternalItem : MediaItem {
     private static string OBJECT_IFACE = "org.Rygel.MediaObject1";
     private static string ITEM_IFACE = "org.Rygel.MediaItem1";
 
-    public ExternalItem (string            service_name,
-                         string            object_path,
+    public ExternalItem (string            object_path,
                          ExternalContainer parent)
                          throws GLib.Error {
         base (object_path,
@@ -45,7 +44,7 @@ public class Rygel.ExternalItem : MediaItem {
 
         DBus.Connection connection = DBus.Bus.get (DBus.BusType.SESSION);
 
-        dynamic DBus.Object props = connection.get_object (service_name,
+        dynamic DBus.Object props = connection.get_object (parent.service_name,
                                                            object_path,
                                                            PROPS_IFACE);
 



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