[rygel] server: Make some SimpleContainer methods protected and documented.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] server: Make some SimpleContainer methods protected and documented.
- Date: Mon, 24 Sep 2012 10:18:57 +0000 (UTC)
commit e6ff958eed6a560773f48ae6feec1336fc48dd89
Author: Murray Cumming <murrayc openismus com>
Date: Thu Sep 13 12:27:50 2012 +0200
server: Make some SimpleContainer methods protected and documented.
Make get_all_children() and is_child_id_unique() protected and
document them as being useful when implementing derived classes,
because they are only used in plugins that derive their own
containers.
src/librygel-server/rygel-simple-container.vala | 22 ++++++++++++++++++++--
1 files changed, 20 insertions(+), 2 deletions(-)
---
diff --git a/src/librygel-server/rygel-simple-container.vala b/src/librygel-server/rygel-simple-container.vala
index 6f3fa3b..13a10fb 100644
--- a/src/librygel-server/rygel-simple-container.vala
+++ b/src/librygel-server/rygel-simple-container.vala
@@ -72,7 +72,17 @@ public class Rygel.SimpleContainer : Rygel.MediaContainer,
this.add_child (child);
}
- public MediaObjects get_all_children () {
+ /**
+ * Get all children, including the empty children.
+ *
+ * This is useful when all children are empty,
+ * so get_children() would return no objects,
+ * but when you need to add items to the empty
+ * items.
+ *
+ * This is useful only when implementing derived classes.
+ */
+ protected MediaObjects get_all_children () {
var all = new MediaObjects ();
all.add_all (this.children);
all.add_all (this.empty_children);
@@ -122,7 +132,15 @@ public class Rygel.SimpleContainer : Rygel.MediaContainer,
this.child_count = 0;
}
- public bool is_child_id_unique (string child_id) {
+ /**
+ * Check that the ID is unique within this container.
+ *
+ * This is useful only when implementing derived classes.
+ *
+ * @param child_id The ID to check for uniqueness.
+ * @return true if the child ID is unique within this container.
+ */
+ protected bool is_child_id_unique (string child_id) {
var unique = true;
foreach (var child in this.children) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]