[rygel] core: Assume item of size 0 to be a place-holder
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] core: Assume item of size 0 to be a place-holder
- Date: Wed, 22 Sep 2010 20:24:58 +0000 (UTC)
commit c4136661414b7ae5db8f4f17891c3c0f8cdbe2ce
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Wed Sep 22 21:44:08 2010 +0300
core: Assume item of size 0 to be a place-holder
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 | 2 +-
src/rygel/rygel-media-item.vala | 18 ++++++++++++++++--
2 files changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/src/rygel/rygel-item-creator.vala b/src/rygel/rygel-item-creator.vala
index 810303d..313f127 100644
--- a/src/rygel/rygel-item-creator.vala
+++ b/src/rygel/rygel-item-creator.vala
@@ -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);
diff --git a/src/rygel/rygel-media-item.vala b/src/rygel/rygel-media-item.vala
index ab5651e..6a34453 100644
--- a/src/rygel/rygel-media-item.vala
+++ b/src/rygel/rygel-media-item.vala
@@ -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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]