[tracker/direct-access] libtracker-bus: Implement query_async



commit cef82e8bda16c27f33d9ae0a42da0b8fe8d1b3c5
Author: Jürg Billeter <j bitron ch>
Date:   Wed Jul 21 11:51:51 2010 +0200

    libtracker-bus: Implement query_async

 src/libtracker-bus/tracker-bus.vala |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-bus/tracker-bus.vala b/src/libtracker-bus/tracker-bus.vala
index 350fb2b..68c2a30 100644
--- a/src/libtracker-bus/tracker-bus.vala
+++ b/src/libtracker-bus/tracker-bus.vala
@@ -22,6 +22,9 @@
 [DBus (name = "org.freedesktop.Tracker1.Resources")]
 private interface Tracker.Bus.Resources : GLib.Object {
 	public abstract string[,] sparql_query (string query) throws DBus.Error;
+	[DBus (name = "SparqlQuery")]
+	public abstract async string[,] sparql_query_async (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;
@@ -96,8 +99,8 @@ public class Tracker.Bus.Connection : Tracker.Sparql.Connection {
 	}
 
 	public async override Sparql.Cursor? query_async (string sparql, Cancellable? cancellable = null) throws GLib.Error {
-		// FIXME: Implement
-		return null;
+		string[,] results = yield resources_object.sparql_query_async (sparql);
+		return new Tracker.Bus.ArrayCursor ((owned) results, results.length[0], results.length[1]);
 	}
 
 	public override void update (string sparql, Cancellable? cancellable = null) throws GLib.Error {



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