[rygel] tracker: Move TrackerQueryTriplet* to separate files
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [rygel] tracker: Move TrackerQueryTriplet* to separate files
- Date: Sat, 5 Dec 2009 01:21:14 +0000 (UTC)
commit 3a74a941861743763868082524cac68d26af0cbf
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Wed Dec 2 01:55:34 2009 +0200
tracker: Move TrackerQueryTriplet* to separate files
Move TrackerQueryTriplet and TrackerQueryTriplets to separate files.
src/plugins/tracker/Makefile.am | 2 +
.../tracker/rygel-tracker-query-triplet.vala | 71 ++++++++++++++++++++
.../tracker/rygel-tracker-query-triplets.vala | 36 ++++++++++
src/plugins/tracker/rygel-tracker-query.vala | 61 -----------------
4 files changed, 109 insertions(+), 61 deletions(-)
---
diff --git a/src/plugins/tracker/Makefile.am b/src/plugins/tracker/Makefile.am
index 085beba..315e8e8 100644
--- a/src/plugins/tracker/Makefile.am
+++ b/src/plugins/tracker/Makefile.am
@@ -16,6 +16,8 @@ librygel_media_tracker_la_SOURCES = \
rygel-tracker-tags.vala \
rygel-tracker-search-container.vala \
rygel-tracker-query.vala \
+ rygel-tracker-query-triplet.vala \
+ rygel-tracker-query-triplets.vala \
rygel-tracker-item-factory.vala \
rygel-tracker-video-item-factory.vala \
rygel-tracker-music-item-factory.vala \
diff --git a/src/plugins/tracker/rygel-tracker-query-triplet.vala b/src/plugins/tracker/rygel-tracker-query-triplet.vala
new file mode 100644
index 0000000..67b0dd4
--- /dev/null
+++ b/src/plugins/tracker/rygel-tracker-query-triplet.vala
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2008 Nokia Corporation.
+ *
+ * Author: Zeeshan Ali <zeenix gmail com>
+ *
+ * This file is part of Rygel.
+ *
+ * Rygel is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Rygel is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+using Gee;
+
+/**
+ * Represents SPARQL Triplet
+ */
+public class Rygel.TrackerQueryTriplet {
+ public string subject;
+ public string predicate;
+ public string obj;
+
+ public bool optional;
+
+ public TrackerQueryTriplet (string? subject,
+ string predicate,
+ string obj,
+ bool optional = true) {
+ this.subject = subject;
+ this.predicate = predicate;
+ this.obj = obj;
+ this.optional = optional;
+ }
+
+ public TrackerQueryTriplet.clone (TrackerQueryTriplet triplet) {
+ this (triplet.subject,
+ triplet.predicate,
+ triplet.obj,
+ triplet.optional);
+ }
+
+ public string to_string () {
+ string str = "";
+
+ if (this.optional) {
+ str += "OPTIONAL {";
+ }
+
+ if (this.subject != null) {
+ str += " " + subject;
+ }
+
+ str += " " + predicate + " " + obj;
+
+ if (this.optional) {
+ str += " }";
+ }
+
+ return str;
+ }
+}
diff --git a/src/plugins/tracker/rygel-tracker-query-triplets.vala b/src/plugins/tracker/rygel-tracker-query-triplets.vala
new file mode 100644
index 0000000..9fb1af2
--- /dev/null
+++ b/src/plugins/tracker/rygel-tracker-query-triplets.vala
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2008 Nokia Corporation.
+ *
+ * Author: Zeeshan Ali <zeenix gmail com>
+ *
+ * This file is part of Rygel.
+ *
+ * Rygel is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Rygel is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+using Gee;
+
+/**
+ * Represents a list of SPARQL Triplet
+ */
+public class Rygel.TrackerQueryTriplets : ArrayList<TrackerQueryTriplet> {
+ public TrackerQueryTriplets.clone (TrackerQueryTriplets triplets) {
+ base ();
+
+ foreach (var triplet in triplets) {
+ this.add (new TrackerQueryTriplet.clone (triplet));
+ }
+ }
+}
diff --git a/src/plugins/tracker/rygel-tracker-query.vala b/src/plugins/tracker/rygel-tracker-query.vala
index c6fc0a4..746a842 100644
--- a/src/plugins/tracker/rygel-tracker-query.vala
+++ b/src/plugins/tracker/rygel-tracker-query.vala
@@ -133,64 +133,3 @@ public class Rygel.TrackerQuery {
return copy;
}
}
-
-/**
- * Represents SPARQL Triplet
- */
-public class Rygel.TrackerQueryTriplet {
- public string subject;
- public string predicate;
- public string obj;
-
- public bool optional;
-
- public TrackerQueryTriplet (string? subject,
- string predicate,
- string obj,
- bool optional = true) {
- this.subject = subject;
- this.predicate = predicate;
- this.obj = obj;
- this.optional = optional;
- }
-
- public TrackerQueryTriplet.clone (TrackerQueryTriplet triplet) {
- this (triplet.subject,
- triplet.predicate,
- triplet.obj,
- triplet.optional);
- }
-
- public string to_string () {
- string str = "";
-
- if (this.optional) {
- str += "OPTIONAL {";
- }
-
- if (this.subject != null) {
- str += " " + subject;
- }
-
- str += " " + predicate + " " + obj;
-
- if (this.optional) {
- str += " }";
- }
-
- return str;
- }
-}
-
-/**
- * Represents a list of SPARQL Triplet
- */
-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]