Commit df768eff authored by Carlos Garnacho's avatar Carlos Garnacho

Revert "Add tracker_sparql_connection_get/set_dbus_connection()"

This reverts commit eb24ea93.

This is an interesting feature, but not a good timing. Punt for
2.2.x that will happen after 3.30.
parent 8cefe799
Pipeline #27494 passed with stage
in 5 minutes and 36 seconds
......@@ -21,13 +21,9 @@ public class Tracker.Bus.Connection : Tracker.Sparql.Connection {
DBusConnection bus;
string dbus_name;
public Connection (string dbus_name, DBusConnection? dbus_connection) throws Sparql.Error, IOError, DBusError, GLib.Error {
public Connection (string dbus_name) 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;
bus = GLib.Bus.get_sync (Tracker.IPC.bus ());
debug ("Waiting for service to become available...");
......
......@@ -19,7 +19,6 @@
static string domain_name = null;
static Tracker.DomainOntology domain_ontology = null;
static DBusConnection global_dbus_connection = null;
class Tracker.Sparql.Backend : Connection {
bool initialized;
......@@ -193,7 +192,7 @@ class Tracker.Sparql.Backend : Connection {
switch (backend) {
case Backend.AUTO:
bus = new Tracker.Bus.Connection (domain_ontology.get_domain ("Tracker1"), global_dbus_connection);
bus = new Tracker.Bus.Connection (domain_ontology.get_domain ("Tracker1"));
try {
direct = create_readonly_direct ();
......@@ -208,7 +207,7 @@ class Tracker.Sparql.Backend : Connection {
break;
case Backend.BUS:
bus = new Tracker.Bus.Connection (domain_ontology.get_domain ("Tracker1"), global_dbus_connection);
bus = new Tracker.Bus.Connection (domain_ontology.get_domain ("Tracker1"));
break;
default:
......@@ -359,11 +358,3 @@ public static void tracker_sparql_connection_set_domain (string? domain) {
public static string? tracker_sparql_connection_get_domain () {
return domain_name;
}
public static void tracker_sparql_connection_set_dbus_connection (DBusConnection dbus_connection) {
global_dbus_connection = dbus_connection;
}
public static DBusConnection? tracker_sparql_connection_get_dbus_connection () {
return global_dbus_connection;
}
......@@ -606,33 +606,4 @@ public abstract class Tracker.Sparql.Connection : Object {
* Since: 2.0
*/
public extern static string? get_domain ();
/**
* tracker_sparql_connection_set_dbus_connection:
* @dbus_connection: A #GDBusConnection to a suitable message bus.
*
* By default, a connection is opened to the session-wide Tracker services
* running on the D-Bus session bus. This function allows you to connect to
* Tracker services that are running on a different bus.
*
* This function must be called before any tracker_sparql_connection_get()
* calls happen.
*
* See also: the TRACKER_IPC_BUS environment variable.
*
* Since: 2.2
*/
public extern static void set_dbus_connection (DBusConnection dbus_connection);
/**
* tracker_sparql_connection_get_dbus_connection:
*
* Gets the D-Bus connection that is used to contact the Tracker services.
*
* Returns: (transfer none): A #GDBusConnection instance, or %NULL if the
* default is being used.
*
* Since: 2.0
*/
public extern static DBusConnection? get_dbus_connection ();
}
......@@ -704,9 +704,7 @@ 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 = tracker_sparql_connection_get_dbus_connection ();
if (!priv->dbus_connection)
priv->dbus_connection = g_bus_get_sync (G_BUS_TYPE_SESSION, cancellable, error);
priv->dbus_connection = g_bus_get_sync (G_BUS_TYPE_SESSION, cancellable, error);
if (!priv->dbus_connection)
return FALSE;
......
......@@ -5,7 +5,7 @@ int
main( string[] args )
{
try {
TestApp app = new TestApp (new Tracker.Bus.Connection ("org.freedesktop.Tracker1", null));
TestApp app = new TestApp (new Tracker.Bus.Connection ("org.freedesktop.Tracker1"));
return app.run ();
} catch (GLib.Error e) {
......
......@@ -5,7 +5,7 @@ int
main( string[] args )
{
try {
TestApp app = new TestApp (new Tracker.Bus.Connection ("org.freedesktop.Tracker1", null));
TestApp app = new TestApp (new Tracker.Bus.Connection ("org.freedesktop.Tracker1"));
return app.run ();
} catch (GLib.Error e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment