Commit 8ecc2a78 authored by Carlos Garnacho's avatar Carlos Garnacho
Browse files

tracker3: Add configuration option to change miner service

This may be useful if using domain ontologies for the tracker-miner
services (e.g. a flatpak app without tracker3 in the host), in this
case the miner service would be based on the app DBus name, thus
queries and notification subscriptions need to change.
parent 3c1d2dc7
......@@ -182,6 +182,8 @@ grl_tracker_source_notify_constructed (GObject *object)
bus_connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);
tracker_notifier_signal_subscribe (self->notifier,
bus_connection,
grl_tracker_miner_service ?
grl_tracker_miner_service :
"org.freedesktop.Tracker3.Miner.Files",
NULL,
NULL);
......
......@@ -84,5 +84,6 @@ extern GrlTrackerCache *grl_tracker_item_cache;
/* tracker plugin config */
extern gchar *grl_tracker_store_path;
extern gchar *grl_tracker_miner_service;
#endif /* _GRL_TRACKER_SOURCE_PRIV_H_ */
......@@ -223,7 +223,10 @@ create_query_string (GrlTrackerQueryType type,
merged_list = get_all_keys (keys, options);
/* Remote miner-fs bits */
g_string_append (str, "SERVICE <dbus:" MINER_FS_BUS_NAME "> { ");
g_string_append_printf (str, "SERVICE <dbus:%s> { ",
grl_tracker_miner_service ?
grl_tracker_miner_service :
MINER_FS_BUS_NAME);
/* Make a subquery so we can apply limit and offset */
g_string_append (str, "SELECT ?mediaType ?urn ");
......
......@@ -56,6 +56,7 @@ GCancellable *grl_tracker_plugin_init_cancel = NULL;
/* tracker plugin config */
gchar *grl_tracker_store_path = NULL;
gchar *grl_tracker_miner_service = NULL;
/* =================== Tracker Plugin =============== */
......@@ -120,6 +121,8 @@ grl_tracker3_plugin_init (GrlRegistry *registry,
grl_tracker_store_path =
grl_config_get_string (config, "store-path");
grl_tracker_miner_service =
grl_config_get_string (config, "miner-service");
}
grl_tracker_plugin_init_cancel = g_cancellable_new ();
......
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