[tracker/libtracker-bus: 49/51] libtracker-sparql, libtracker-bus: Fix default update-blank method



commit 43bb7269ae3e584caf895142ba022b3e1d6c34d2
Author: Philip Van Hoof <philip codeminded be>
Date:   Mon Jul 26 10:42:42 2010 +0200

    libtracker-sparql, libtracker-bus: Fix default update-blank method

 src/libtracker-bus/tracker-bus.vala            |   25 +++++++----------------
 tests/functional-tests/shared-update-test.vala |   13 +++--------
 2 files changed, 12 insertions(+), 26 deletions(-)
---
diff --git a/src/libtracker-bus/tracker-bus.vala b/src/libtracker-bus/tracker-bus.vala
index 745c3f8..f2a2600 100644
--- a/src/libtracker-bus/tracker-bus.vala
+++ b/src/libtracker-bus/tracker-bus.vala
@@ -142,30 +142,21 @@ public class Tracker.Bus.Connection : Tracker.Sparql.Connection {
 	public override GLib.Variant? update_blank (string sparql, Cancellable? cancellable = null) throws Sparql.Error {
 		GLib.Variant res = null;
 
-		try {
-			if (use_steroids) {
-				res = tracker_bus_fd_sparql_update_blank (connection, sparql);
-			} else {
-				res = tracker_bus_array_sparql_update_blank (connection, sparql);
-			}
-		} catch (DBus.Error e) {
-			throw new Sparql.Error.INTERNAL (e.message);
+		if (use_steroids) {
+			res = tracker_bus_fd_sparql_update_blank (connection, sparql);
+		} else {
+			res = tracker_bus_array_sparql_update_blank (connection, sparql);
 		}
-
 		return res;
 	}
 
 	public async override GLib.Variant? update_blank_async (string sparql, int priority = GLib.Priority.DEFAULT, Cancellable? cancellable = null) throws Sparql.Error {
 		GLib.Variant res = null;
 
-		try {
-			if (use_steroids) {
-				res = yield tracker_bus_fd_sparql_update_blank_async (connection, sparql, cancellable);
-			} else {
-				res = yield tracker_bus_array_sparql_update_blank_async (connection, sparql, cancellable);
-			}
-		} catch (DBus.Error e) {
-			throw new Sparql.Error.INTERNAL (e.message);
+		if (use_steroids) {
+			res = yield tracker_bus_fd_sparql_update_blank_async (connection, sparql, cancellable);
+		} else {
+			res = yield tracker_bus_array_sparql_update_blank_async (connection, sparql, cancellable);
 		}
 
 		return res;
diff --git a/tests/functional-tests/shared-update-test.vala b/tests/functional-tests/shared-update-test.vala
index 355f1be..caa7bc4 100644
--- a/tests/functional-tests/shared-update-test.vala
+++ b/tests/functional-tests/shared-update-test.vala
@@ -63,14 +63,14 @@ public class TestApp : GLib.Object {
 		int a;
 
 		try {
-			yield con.update_async ("INSERT { <test01> a nie:InformationElement ; nie:title 'test01' }");
+			yield con.update_async ("INSERT { <test02> a nie:InformationElement ; nie:title 'test01' }");
 		} catch (Tracker.Sparql.Error ea) {
 			warning ("Couldn't update: %s", ea.message);
 			res = -1;
 		}
 
 		try {
-			cursor = con.query ("SELECT ?title WHERE { <test01> nie:title ?title }");
+			cursor = con.query ("SELECT ?title WHERE { <test02> nie:title ?title }");
 			a = iter_cursor (cursor);
 		} catch (Tracker.Sparql.Error eb) {
 			warning ("Couldn't query: %s", eb.message);
@@ -78,15 +78,12 @@ public class TestApp : GLib.Object {
 		}
 	}
 
-
-	string blank_query = "INSERT { _:a2 a nie:InformationElement  . _:b2 a nie:InformationElement . _:c2 a nie:InformationElement }";
-
 	void update_blank_query () {
 		GLib.Variant variant;
 		int a;
 
 		try {
-			variant = con.update_blank (blank_query);
+			variant = con.update_blank ("INSERT { _:a1 a nie:InformationElement  . _:b1 a nie:InformationElement . _:c1 a nie:InformationElement }");
 			a = iter_variant (variant);
 		} catch (Tracker.Sparql.Error ea) {
 			warning ("Couldn't update: %s", ea.message);
@@ -94,14 +91,12 @@ public class TestApp : GLib.Object {
 		}
 	}
 
-
-
 	async void update_blank_query_async () {
 		GLib.Variant variant;
 		int a;
 
 		try {
-			variant = yield con.update_blank_async (blank_query);
+			variant = yield con.update_blank_async ("INSERT { _:a2 a nie:InformationElement  . _:b2 a nie:InformationElement . _:c2 a nie:InformationElement }");
 			a = iter_variant (variant);
 		} catch (Tracker.Sparql.Error ea) {
 			warning ("Couldn't update: %s", ea.message);



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