[rygel/gnome-2-32] tracker: Honor 'nmm:uPnPShared' property
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel/gnome-2-32] tracker: Honor 'nmm:uPnPShared' property
- Date: Mon, 18 Oct 2010 20:58:31 +0000 (UTC)
commit 367e429599103b9a4e553b26a45fbb99176a87ad
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Wed Oct 13 20:15:13 2010 +0300
tracker: Honor 'nmm:uPnPShared' property
Make sure we only expose items that are either explicity marked to be shared
over UPnP network or not marked at all.
.../tracker/rygel-tracker-selection-query.vala | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/src/plugins/tracker/rygel-tracker-selection-query.vala b/src/plugins/tracker/rygel-tracker-selection-query.vala
index 020b549..7a13a9c 100644
--- a/src/plugins/tracker/rygel-tracker-selection-query.vala
+++ b/src/plugins/tracker/rygel-tracker-selection-query.vala
@@ -27,6 +27,11 @@ using Gee;
*/
public class Rygel.Tracker.SelectionQuery : Query {
public const string ITEM_VARIABLE = "?item";
+ private const string SHARED_FILTER = "(!BOUND(nmm:uPnPShared(" +
+ ITEM_VARIABLE + ")) ||" +
+ " nmm:uPnPShared(" +
+ ITEM_VARIABLE +
+ ") = true)";
public ArrayList<string> variables;
public ArrayList<string> filters;
@@ -84,12 +89,17 @@ public class Rygel.Tracker.SelectionQuery : Query {
query += " WHERE { " + base.to_string ();
- if (this.filters.size > 0) {
+ var filters = new ArrayList<string> ();
+ filters.add_all (this.filters);
+ // Make sure we don't expose items that are marked not to be shared
+ filters.add (SHARED_FILTER);
+
+ if (filters.size > 0) {
query += " FILTER (";
- for (var i = 0; i < this.filters.size; i++) {
- query += this.filters[i];
+ for (var i = 0; i < filters.size; i++) {
+ query += filters[i];
- if (i < this.filters.size - 1) {
+ if (i < filters.size - 1) {
query += " && ";
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]