[rygel] tracker: Refactor query triplets
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] tracker: Refactor query triplets
- Date: Sun, 11 Dec 2011 17:00:37 +0000 (UTC)
commit bf17d1f5d01c4af90d82beb5b77343618324af69
Author: Lukasz Pawlik <lucas pawlik gmail com>
Date: Tue Nov 8 15:42:17 2011 +0100
tracker: Refactor query triplets
Use add method from base class.
src/plugins/tracker/rygel-tracker-new.vala | 12 ++++++------
.../tracker/rygel-tracker-query-triplets.vala | 8 ++++----
.../tracker/rygel-tracker-search-container.vala | 8 ++++----
3 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/src/plugins/tracker/rygel-tracker-new.vala b/src/plugins/tracker/rygel-tracker-new.vala
index 9b87fc8..b725385 100644
--- a/src/plugins/tracker/rygel-tracker-new.vala
+++ b/src/plugins/tracker/rygel-tracker-new.vala
@@ -34,12 +34,12 @@ public class Rygel.Tracker.New : Rygel.Tracker.SearchContainer {
public New (MediaContainer parent, ItemFactory item_factory) {
var triplets = new QueryTriplets ();
- triplets.add_triplet (new QueryTriplet (SelectionQuery.ITEM_VARIABLE,
- "a",
- item_factory.category));
- triplets.add_triplet (new QueryTriplet (SelectionQuery.ITEM_VARIABLE,
- ADDED_PREDICATE,
- ADDED_VARIABLE));
+ triplets.add (new QueryTriplet (SelectionQuery.ITEM_VARIABLE,
+ "a",
+ item_factory.category));
+ triplets.add (new QueryTriplet (SelectionQuery.ITEM_VARIABLE,
+ ADDED_PREDICATE,
+ ADDED_VARIABLE));
var time = TimeVal ();
time.tv_sec -= THREE_DAYS_AS_SEC;
diff --git a/src/plugins/tracker/rygel-tracker-query-triplets.vala b/src/plugins/tracker/rygel-tracker-query-triplets.vala
index e8192ac..89b678b 100644
--- a/src/plugins/tracker/rygel-tracker-query-triplets.vala
+++ b/src/plugins/tracker/rygel-tracker-query-triplets.vala
@@ -73,12 +73,12 @@ public class Rygel.Tracker.QueryTriplets : ArrayList<QueryTriplet> {
return str;
}
- // FIXME: Remove this method and override 'add' method from the base class
- // instead once bug#623685 is fixed.
- public void add_triplet (QueryTriplet triplet) {
+ public override bool add (QueryTriplet triplet) {
if (!this.contains (triplet)) {
- this.add (triplet);
+ return base.add (triplet);
}
+
+ return false;
}
private bool check_graph_change (int i) {
diff --git a/src/plugins/tracker/rygel-tracker-search-container.vala b/src/plugins/tracker/rygel-tracker-search-container.vala
index b913c8a..5145cdd 100644
--- a/src/plugins/tracker/rygel-tracker-search-container.vala
+++ b/src/plugins/tracker/rygel-tracker-search-container.vala
@@ -77,10 +77,10 @@ public class Rygel.Tracker.SearchContainer : SimpleContainer {
our_triplets = new QueryTriplets ();
}
- our_triplets.add_triplet (new QueryTriplet
- (SelectionQuery.ITEM_VARIABLE,
- "a",
- item_factory.category));
+ our_triplets.add (new QueryTriplet
+ (SelectionQuery.ITEM_VARIABLE,
+ "a",
+ item_factory.category));
var key_chain_map = KeyChainMap.get_key_chain_map ();
foreach (var property in this.item_factory.properties) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]