[tracker/libtracker-bus: 11/50] libtracker-bus: Add simple implementations for update and update_async
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/libtracker-bus: 11/50] libtracker-bus: Add simple implementations for update and update_async
- Date: Fri, 6 Aug 2010 11:18:36 +0000 (UTC)
commit 3d9c83a2be7b3ddfe10cb00f2222d3f5329ee717
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]