[rygel] tracker: Fix url filter
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] tracker: Fix url filter
- Date: Wed, 24 Aug 2016 19:41:47 +0000 (UTC)
commit 3bb8cf87db99987d065c0598ba5358c22676da48
Author: Jens Georg <mail jensge org>
Date: Wed Aug 24 21:38:59 2016 +0200
tracker: Fix url filter
Filter was created incorrectly (missing ||) when more than one limiting
directory was used.
Signed-off-by: Jens Georg <mail jensge org>
.../tracker/rygel-tracker-selection-query.vala | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/src/plugins/tracker/rygel-tracker-selection-query.vala
b/src/plugins/tracker/rygel-tracker-selection-query.vala
index 02123a0..0859d65 100644
--- a/src/plugins/tracker/rygel-tracker-selection-query.vala
+++ b/src/plugins/tracker/rygel-tracker-selection-query.vala
@@ -72,7 +72,7 @@ public class Rygel.Tracker.SelectionQuery : Query {
this.max_count = max_count;
ArrayList<string> uris;
- ArrayList<File> actual_uris;
+ string[] uri_filters = new string[0];
var config = MetaConfig.get_default ();
@@ -82,8 +82,6 @@ public class Rygel.Tracker.SelectionQuery : Query {
uris = new ArrayList<string> ();
}
- actual_uris = new ArrayList<File> ((EqualDataFunc<File>) File.equal);
-
var home_dir = File.new_for_path (Environment.get_home_dir ());
unowned string pictures_dir = Environment.get_user_special_dir
(UserDirectory.PICTURES);
@@ -92,7 +90,6 @@ public class Rygel.Tracker.SelectionQuery : Query {
unowned string music_dir = Environment.get_user_special_dir
(UserDirectory.MUSIC);
- uri_filter = "(";
foreach (var uri in uris) {
var file = File.new_for_commandline_arg (uri);
if (!file.equal (home_dir)) {
@@ -114,14 +111,15 @@ public class Rygel.Tracker.SelectionQuery : Query {
continue;
}
- uri_filter += "tracker:uri-is-descendant(\"%s\", nie:url(%s))".printf
+ uri_filters += "tracker:uri-is-descendant(\"%s\", nie:url(%s))".printf
(file.get_uri (), ITEM_VARIABLE);
}
}
- if (uri_filter != "(") {
- uri_filter += ")";
+
+ if (uri_filters.length != 0) {
+ this.uri_filter = "(%s)".printf (string.joinv ("||", uri_filters));
} else {
- uri_filter = null;
+ this.uri_filter = null;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]