[rygel] media-export: Add GetUris DBus command



commit cf7fddfd3863dd6c157e41123417e8564593bec1
Author: Jens Georg <mail jensge org>
Date:   Mon Sep 21 15:12:30 2009 +0200

    media-export: Add GetUris DBus command

 .../rygel-media-export-dbus-service.vala           |    4 ++++
 .../rygel-media-export-root-container.vala         |   13 +++++++++++++
 2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-dbus-service.vala b/src/plugins/media-export/rygel-media-export-dbus-service.vala
index 8ba343f..1cdaf23 100644
--- a/src/plugins/media-export/rygel-media-export-dbus-service.vala
+++ b/src/plugins/media-export/rygel-media-export-dbus-service.vala
@@ -57,4 +57,8 @@ public class Rygel.MediaExportDBusService : Object {
     public void RemoveUri (string uri) {
         this.root_container.remove_uri (uri);
     }
+
+    public string[] GetUris () {
+        return this.root_container.get_dynamic_uris ();
+    }
 }
diff --git a/src/plugins/media-export/rygel-media-export-root-container.vala b/src/plugins/media-export/rygel-media-export-root-container.vala
index 258094b..7138f20 100644
--- a/src/plugins/media-export/rygel-media-export-root-container.vala
+++ b/src/plugins/media-export/rygel-media-export-root-container.vala
@@ -122,6 +122,19 @@ public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer {
         }
     }
 
+    public string[] get_dynamic_uris () {
+        string[] result = new string[0];
+        var dynamic_uris = this.dynamic_elements.get_uris ();
+
+        // copy by hand, to_array does not work due to
+        // vala bug 568972
+        foreach (string uri in dynamic_uris) {
+            result += uri;
+        }
+
+        return result;
+    }
+
 
     /**
      * Create a new root container.



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