[tracker] libtracker-sparql: Fix fallback from direct access to D-Bus



commit dd81271c8b753b88dd2cd4231ba6168769190f93
Author: Jürg Billeter <j bitron ch>
Date:   Tue Apr 12 16:24:04 2011 +0200

    libtracker-sparql: Fix fallback from direct access to D-Bus
    
    Fixes NB#238770.

 src/libtracker-bus/tracker-bus.vala                |    3 ---
 src/libtracker-direct/tracker-direct.vala          |    5 +----
 src/libtracker-sparql-backend/tracker-backend.vala |   14 +++-----------
 src/libtracker-sparql/tracker-connection.vala      |    4 ----
 4 files changed, 4 insertions(+), 22 deletions(-)
---
diff --git a/src/libtracker-bus/tracker-bus.vala b/src/libtracker-bus/tracker-bus.vala
index 855d90d..779b623 100644
--- a/src/libtracker-bus/tracker-bus.vala
+++ b/src/libtracker-bus/tracker-bus.vala
@@ -80,9 +80,6 @@ public class Tracker.Bus.Connection : Tracker.Sparql.Connection {
 		initialized = true;
 	}
 
-	public override void init () throws Sparql.Error, IOError, DBusError {
-	}
-
 	~Connection () {
 		initialized = false;
 	}
diff --git a/src/libtracker-direct/tracker-direct.vala b/src/libtracker-direct/tracker-direct.vala
index 87aa6cc..4b86b3c 100644
--- a/src/libtracker-direct/tracker-direct.vala
+++ b/src/libtracker-direct/tracker-direct.vala
@@ -21,11 +21,8 @@ public class Tracker.Direct.Connection : Tracker.Sparql.Connection {
 	// only single connection is currently supported per process
 	static bool initialized;
 
-	public Connection () throws GLib.Error
+	public Connection () throws Sparql.Error, IOError, DBusError
 	requires (!initialized) {
-	}
-
-	public override void init () throws Sparql.Error, IOError, DBusError {
 		uint select_cache_size = 100;
 		string env_cache_size = Environment.get_variable ("TRACKER_SPARQL_CACHE_SIZE");
 
diff --git a/src/libtracker-sparql-backend/tracker-backend.vala b/src/libtracker-sparql-backend/tracker-backend.vala
index 18bb9a3..110a203 100644
--- a/src/libtracker-sparql-backend/tracker-backend.vala
+++ b/src/libtracker-sparql-backend/tracker-backend.vala
@@ -31,7 +31,7 @@ class Tracker.Sparql.Backend : Connection {
 		BUS
 	}
 
-	public override void init () throws Sparql.Error, IOError, DBusError, SpawnError {
+	public Backend () throws Sparql.Error, IOError, DBusError, SpawnError {
 		Tracker.Backend.Status status = GLib.Bus.get_proxy_sync (BusType.SESSION,
 		                                                         TRACKER_DBUS_SERVICE,
 		                                                         TRACKER_DBUS_OBJECT_STATUS,
@@ -45,15 +45,8 @@ class Tracker.Sparql.Backend : Connection {
 
 		try {
 			debug ("Constructing connection, direct_only=%s", direct_only ? "true" : "false");
-			if (load_plugins (direct_only)) {
-				debug ("Waiting for backend to become available...");
-				if (direct != null) {
-					direct.init ();
-				} else {
-					bus.init ();
-				}
-				debug ("Backend is ready");
-			}
+			load_plugins (direct_only);
+			debug ("Backend is ready");
 		} catch (GLib.Error e) {
 			throw new Sparql.Error.INTERNAL (e.message);
 		}
@@ -215,7 +208,6 @@ class Tracker.Sparql.Backend : Connection {
 		direct_only = is_direct_only;
 
 		result = new Tracker.Sparql.Backend ();
-		result.init ();
 
 		if (cancellable != null && cancellable.is_cancelled ()) {
 			door.unlock ();
diff --git a/src/libtracker-sparql/tracker-connection.vala b/src/libtracker-sparql/tracker-connection.vala
index 030836b..4ad008d 100644
--- a/src/libtracker-sparql/tracker-connection.vala
+++ b/src/libtracker-sparql/tracker-connection.vala
@@ -200,10 +200,6 @@ public abstract class Tracker.Sparql.Connection : Object {
 	 */
 	public extern static new Connection get_direct (Cancellable? cancellable = null) throws Sparql.Error, IOError, DBusError, SpawnError;
 
-	public virtual void init () throws Sparql.Error, IOError, DBusError, SpawnError {
-		warning ("Interface 'init' not implemented");
-	}
-
 	/**
 	 * tracker_sparql_connection_query:
 	 * @self: a #TrackerSparqlConnection



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