[rygel] core: Implement LogicalExpression.satisfied_by()
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [rygel] core: Implement LogicalExpression.satisfied_by()
- Date: Mon, 9 Nov 2009 18:46:16 +0000 (UTC)
commit ac150672dfb6f522eb78a55d103fd4a9537f2d0e
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Wed Nov 4 17:19:43 2009 +0200
core: Implement LogicalExpression.satisfied_by()
src/rygel/rygel-search-expression.vala | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/rygel/rygel-search-expression.vala b/src/rygel/rygel-search-expression.vala
index 01f5790..46da853 100644
--- a/src/rygel/rygel-search-expression.vala
+++ b/src/rygel/rygel-search-expression.vala
@@ -115,7 +115,16 @@ public class Rygel.LogicalExpression :
SearchExpression,
SearchExpression> {
public override bool satisfied_by (MediaObject media_object) {
- return true;
+ switch (this.op) {
+ case LogicalOperator.AND:
+ return this.operand1.satisfied_by (media_object) &&
+ this.operand2.satisfied_by (media_object);
+ case LogicalOperator.OR:
+ return this.operand1.satisfied_by (media_object) ||
+ this.operand2.satisfied_by (media_object);
+ default:
+ return false;
+ }
}
public override string to_string () {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]