[rygel] tracker: Cloneable TrackerQueryTriplet*



commit 11aca147e6aa218ab93fb4730c44d966f9a3ce2f
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Mon Nov 30 16:18:42 2009 +0200

    tracker: Cloneable TrackerQueryTriplet*
    
    Add ability to clone TrackerQueryTriplet and TrackerQueryTriplets.

 src/plugins/tracker/rygel-tracker-query.vala |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/tracker/rygel-tracker-query.vala b/src/plugins/tracker/rygel-tracker-query.vala
index 66e6a04..5e8877b 100644
--- a/src/plugins/tracker/rygel-tracker-query.vala
+++ b/src/plugins/tracker/rygel-tracker-query.vala
@@ -146,6 +146,13 @@ public class Rygel.TrackerQueryTriplet {
         this.optional = optional;
     }
 
+    public TrackerQueryTriplet.clone (TrackerQueryTriplet triplet) {
+        this (triplet.subject,
+              triplet.predicate,
+              triplet.obj,
+              triplet.optional);
+    }
+
     public string to_string () {
         string str = "";
 
@@ -170,4 +177,12 @@ public class Rygel.TrackerQueryTriplet {
 /**
  * Represents a list of SPARQL Triplet
  */
-public class Rygel.TrackerQueryTriplets : ArrayList<TrackerQueryTriplet> {}
+public class Rygel.TrackerQueryTriplets : ArrayList<TrackerQueryTriplet> {
+    public TrackerQueryTriplets.clone (TrackerQueryTriplets triplets) {
+        base ();
+
+        foreach (var triplet in triplets) {
+            this.add (new TrackerQueryTriplet.clone (triplet));
+        }
+    }
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]