[rygel] core: INT_MAX children means "Don't know"
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] core: INT_MAX children means "Don't know"
- Date: Tue, 17 Jul 2012 06:47:38 +0000 (UTC)
commit fd4648a937cdd1d704eacb58d59927dcff367205
Author: Jens Georg <mail jensge org>
Date: Sat Feb 25 17:26:02 2012 +0200
core: INT_MAX children means "Don't know"
https://bugzilla.gnome.org/show_bug.cgi?id=661988
src/librygel-core/rygel-browse.vala | 6 +++++-
src/plugins/external/rygel-external-container.vala | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/librygel-core/rygel-browse.vala b/src/librygel-core/rygel-browse.vala
index b7c8af6..a4b6119 100644
--- a/src/librygel-core/rygel-browse.vala
+++ b/src/librygel-core/rygel-browse.vala
@@ -95,7 +95,11 @@ internal class Rygel.Browse: Rygel.MediaQueryAction {
}
var container = (MediaContainer) media_object;
- this.total_matches = container.child_count;
+ if (container.child_count < int.MAX) {
+ this.total_matches = container.child_count;
+ } else {
+ this.total_matches = 0;
+ }
if (this.requested_count == 0) {
// No max count requested, try to fetch all children
diff --git a/src/plugins/external/rygel-external-container.vala b/src/plugins/external/rygel-external-container.vala
index 9991520..bc279ff 100644
--- a/src/plugins/external/rygel-external-container.vala
+++ b/src/plugins/external/rygel-external-container.vala
@@ -48,7 +48,7 @@ public class Rygel.External.Container : Rygel.MediaContainer,
string service_name,
string path,
Container? parent = null) throws IOError {
- base (id, parent, title, (int) child_count);
+ base (id, parent, title, (int) child_count.clamp (0, int.MAX));
this.service_name = service_name;
this.item_factory = new ItemFactory ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]