[tracker/wip/carlosg/tracker-3.0-api-breaks: 46/79] libtracker-bus: Drop usage of Tracker.IPC



commit f60496816338e19e365acae14e276e38bfd999c3
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Dec 30 18:03:50 2019 +0100

    libtracker-bus: Drop usage of Tracker.IPC
    
    The bus used is up to the user of TrackerEndpoint, we no longer need
    a global switch.

 src/libtracker-bus/tracker-bus.vala                | 6 +-----
 src/libtracker-sparql-backend/tracker-backend.vala | 8 +++++++-
 2 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/src/libtracker-bus/tracker-bus.vala b/src/libtracker-bus/tracker-bus.vala
index 25871335f..455d274c4 100644
--- a/src/libtracker-bus/tracker-bus.vala
+++ b/src/libtracker-bus/tracker-bus.vala
@@ -26,11 +26,7 @@ public class Tracker.Bus.Connection : Tracker.Sparql.Connection {
 
        public Connection (string dbus_name, DBusConnection? dbus_connection) throws Sparql.Error, IOError, 
DBusError, GLib.Error {
                this.dbus_name = dbus_name;
-
-               if (dbus_connection == null)
-                       bus = GLib.Bus.get_sync (Tracker.IPC.bus ());
-               else
-                       bus = dbus_connection;
+               this.bus = dbus_connection;
 
                // ensure that error domain is registered with GDBus
                new Sparql.Error.INTERNAL ("");
diff --git a/src/libtracker-sparql-backend/tracker-backend.vala 
b/src/libtracker-sparql-backend/tracker-backend.vala
index 4b89ed1ce..05d5de54c 100644
--- a/src/libtracker-sparql-backend/tracker-backend.vala
+++ b/src/libtracker-sparql-backend/tracker-backend.vala
@@ -22,7 +22,13 @@ public static Tracker.Sparql.Connection tracker_sparql_connection_remote_new (st
 }
 
 public static Tracker.Sparql.Connection tracker_sparql_connection_bus_new (string service, DBusConnection? 
conn) throws Tracker.Sparql.Error, IOError, DBusError, GLib.Error {
-       return new Tracker.Bus.Connection (service, conn);
+       GLib.DBusConnection dbus_conn;
+       if (conn != null)
+               dbus_conn = conn;
+       else
+               dbus_conn = GLib.Bus.get_sync (GLib.BusType.SESSION, null);
+
+       return new Tracker.Bus.Connection (service, dbus_conn);
 }
 
 public static Tracker.Sparql.Connection tracker_sparql_connection_new (Tracker.Sparql.ConnectionFlags flags, 
File store, File? ontology, Cancellable? cancellable = null) throws GLib.Error, Tracker.Sparql.Error, IOError 
{


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