core: Assume item of size 0 to be a place-holder
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Wed, 22 Sep 2010 18:44:08 +0000 (21:44 +0300)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Wed, 22 Sep 2010 20:24:39 +0000 (23:24 +0300)
We don't need to expose MediaItem.place_holder anymore as its now
automatically determined by size (which is now a property).

src/rygel/rygel-item-creator.vala
src/rygel/rygel-media-item.vala

index 810303d..313f127 100644 (file)
@@ -95,7 +95,7 @@ internal class Rygel.ItemCreator: GLib.Object, Rygel.StateMachine {
                 this.item.mime_type = this.get_generic_mime_type ();
             }
 
-            this.item.place_holder = true;
+            this.item.size = 0;
 
             yield container.add_item (this.item, this.cancellable);
             this.item.serialize (didl_writer, this.content_dir.http_server);
index ab5651e..6a34453 100644 (file)
@@ -39,9 +39,23 @@ public abstract class Rygel.MediaItem : MediaObject {
     public string mime_type;
     public string dlna_profile;
 
-    public int64 size = -1;     // Size in bytes
+    // Size in bytes
+    private int64 _size = -1;
+    public int64 size {
+        get {
+            return this._size;
+        }
+
+        set {
+            if (value == 0) {
+                this.place_holder = true;
+            }
+
+            this._size = value;
+        }
+    }   // Size in bytes
 
-    internal bool place_holder = false;
+    protected bool place_holder = false;
 
     public MediaItem (string         id,
                       MediaContainer parent,