[tracker/libtracker-bus: 10/51] libtracker-bus: Add simple implementations for update and update_async



commit 0012f3d39a9e5dd4a3f8cf8a96b060bd925485cf
Author: Jürg Billeter <j bitron ch>
Date:   Mon Jul 19 18:39:11 2010 +0200

    libtracker-bus: Add simple implementations for update and update_async

 src/libtracker-bus/tracker-bus.vala |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-bus/tracker-bus.vala b/src/libtracker-bus/tracker-bus.vala
index c7e1c9f..cf1d75a 100644
--- a/src/libtracker-bus/tracker-bus.vala
+++ b/src/libtracker-bus/tracker-bus.vala
@@ -25,7 +25,10 @@ public const string TRACKER_DBUS_OBJECT_STEROIDS = "/org/freedesktop/Tracker1/St
 
 [DBus (name = "org.freedesktop.Tracker1.Resources")]
 private interface Tracker.Bus.Resources : GLib.Object {
-	public abstract string[,] SparqlQuery (string query) throws DBus.Error;
+	public abstract string[,] sparql_query (string query) throws DBus.Error;
+	public abstract void sparql_update (string query) throws DBus.Error;
+	[DBus (name = "SparqlUpdate")]
+	public abstract async void sparql_update_async (string query) throws DBus.Error;
 }
 
 // Imported DBus FD API until we have support with Vala
@@ -76,7 +79,7 @@ public class Tracker.Bus.Connection : Tracker.Sparql.Connection {
 		if (use_steroids) {
 			return tracker_bus_fd_query (connection, sparql);
 		} else {
-			string[,] results = resources.SparqlQuery (sparql);
+			string[,] results = resources.sparql_query (sparql);
 			return new Tracker.Bus.ArrayCursor ((owned) results, results.length[0], results.length[1]);
 		}
 	}
@@ -85,6 +88,14 @@ public class Tracker.Bus.Connection : Tracker.Sparql.Connection {
 		// FIXME: Implement
 		return null;
 	}
+
+	public override void update (string sparql, Cancellable? cancellable = null) throws GLib.Error {
+		resources.sparql_update (sparql);
+	}
+
+	public async override void update_async (string sparql, int? priority = GLib.Priority.DEFAULT, Cancellable? cancellable = null) throws GLib.Error {
+		yield resources.sparql_update_async (sparql);
+	}
 }
 
 public Tracker.Sparql.Connection module_init () {



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