[rygel] media-export: Correctly use null SearchExpression
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] media-export: Correctly use null SearchExpression
- Date: Thu, 5 Aug 2010 14:31:26 +0000 (UTC)
commit 8224b961318ebf65a2a8bed5085d8cd67dddaf0d
Author: Jens Georg <mail jensge org>
Date: Wed Aug 4 19:23:13 2010 +0300
media-export: Correctly use null SearchExpression
QueryContainers are based on searches so if a null search expression is
passed the container's own search expression which is constructed from
the folder description needs to be used.
.../rygel-media-export-query-container.vala | 23 +++++++++----------
1 files changed, 11 insertions(+), 12 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-query-container.vala b/src/plugins/media-export/rygel-media-export-query-container.vala
index 8edec7c..738cf49 100644
--- a/src/plugins/media-export/rygel-media-export-query-container.vala
+++ b/src/plugins/media-export/rygel-media-export-query-container.vala
@@ -152,20 +152,19 @@ internal class Rygel.MediaExport.QueryContainer : DBContainer {
out uint total_matches,
Cancellable? cancellable)
throws GLib.Error {
- if (expression == null) {
- return yield base.search (expression,
- offset,
- max_count,
- out total_matches,
- cancellable);
- }
-
MediaObjects children = null;
- var combined_expression = new LogicalExpression ();
- combined_expression.operand1 = this.expression;
- combined_expression.op = LogicalOperator.AND;
- combined_expression.operand2 = expression;
+ SearchExpression combined_expression;
+
+ if (expression == null) {
+ combined_expression = this.expression;
+ } else {
+ var local_expression = new LogicalExpression ();
+ local_expression.operand1 = this.expression;
+ local_expression.op = LogicalOperator.AND;
+ local_expression.operand2 = expression;
+ combined_expression = local_expression;
+ }
var max_objects = max_count;
if (max_objects == 0) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]