From eb24ea93bc550934d15223d002b490143e604921 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Fri, 20 Apr 2018 19:00:31 +0200 Subject: Add tracker_sparql_connection_get/set_dbus_connection() Currently it's only possible to open a TrackerSparqlConnection to an instance of Tracker that is running on the session-wide message bus. There are use cases for running the Tracker daemons on a private session bus though. In fact it's necessary to do this if you want to set up a custom domain without having to become root and create .service files in /usr/share/dbus-1/services. It would also be useful for the functional-tests to be able to use libtracker-sparql instead of having to talk directly to Tracker's D-Bus API. --- src/libtracker-sparql/tracker-notifier.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/libtracker-sparql/tracker-notifier.c') diff --git a/src/libtracker-sparql/tracker-notifier.c b/src/libtracker-sparql/tracker-notifier.c index 72b29da65..7058955c0 100644 --- a/src/libtracker-sparql/tracker-notifier.c +++ b/src/libtracker-sparql/tracker-notifier.c @@ -704,7 +704,9 @@ tracker_notifier_initable_init (GInitable *initable, tracker_notifier_cache_id (notifier, "nie:dataSource"); tracker_notifier_cache_id (notifier, "tracker:extractor-data-source"); - priv->dbus_connection = g_bus_get_sync (G_BUS_TYPE_SESSION, cancellable, error); + priv->dbus_connection = tracker_sparql_connection_get_dbus_connection (); + if (!priv->dbus_connection) + priv->dbus_connection = g_bus_get_sync (G_BUS_TYPE_SESSION, cancellable, error); if (!priv->dbus_connection) return FALSE; -- cgit v1.2.1