[rygel] core: Provide 'childCount' only when requested



commit 8a25e3cf8d1f470d523df573175942a12d01af59
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Jun 24 14:26:03 2009 +0300

    core: Provide 'childCount' only when requested

 src/rygel/rygel-didl-lite-writer.vala |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/rygel/rygel-didl-lite-writer.vala b/src/rygel/rygel-didl-lite-writer.vala
index ba368e5..02300ad 100644
--- a/src/rygel/rygel-didl-lite-writer.vala
+++ b/src/rygel/rygel-didl-lite-writer.vala
@@ -124,6 +124,7 @@ internal class Rygel.DIDLLiteWriter : GUPnP.DIDLLiteWriter {
                                       BrowseFilter   filter)
                                       throws Error {
         string parent_id;
+        int child_count = -1;
 
         if (container.parent != null) {
             parent_id = container.parent.id;
@@ -131,9 +132,13 @@ internal class Rygel.DIDLLiteWriter : GUPnP.DIDLLiteWriter {
             parent_id = "-1";
         }
 
+        if (filter.have ("childCount", null)) {
+            child_count = (int) container.child_count;
+        }
+
         this.start_container (container.id,
                               parent_id,
-                              (int) container.child_count,
+                              child_count,
                               false,
                               false);
         this.add_string ("class",



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