[tracker-miners/wip/carlosg/shuffle-libtracker-miner: 88/116] libtracker-miner: Drop pause/resume on tracker-store name availability
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/wip/carlosg/shuffle-libtracker-miner: 88/116] libtracker-miner: Drop pause/resume on tracker-store name availability
- Date: Thu, 12 Dec 2019 12:13:53 +0000 (UTC)
commit 9f85c466d8264dd8584b8cf7f88debd4240460ac
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Nov 11 15:56:32 2018 +0100
libtracker-miner: Drop pause/resume on tracker-store name availability
This no longer makes sense with tracker-store automatic shutdown, assume
the activatable through DBus and keep the miner running in that situation.
src/libtracker-miner/tracker-miner-proxy.c | 75 ------------------------------
1 file changed, 75 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-proxy.c b/src/libtracker-miner/tracker-miner-proxy.c
index e05668cb1..a53054292 100644
--- a/src/libtracker-miner/tracker-miner-proxy.c
+++ b/src/libtracker-miner/tracker-miner-proxy.c
@@ -51,9 +51,7 @@ typedef struct {
GDBusNodeInfo *introspection_data;
gchar *dbus_path;
guint registration_id;
- guint watch_name_id;
GHashTable *pauses;
- gint availability_cookie;
} TrackerMinerProxyPrivate;
typedef struct {
@@ -222,10 +220,6 @@ tracker_miner_proxy_finalize (GObject *object)
g_free (priv->dbus_path);
g_hash_table_unref (priv->pauses);
- if (priv->watch_name_id != 0) {
- g_bus_unwatch_name (priv->watch_name_id);
- }
-
if (priv->registration_id != 0) {
g_dbus_connection_unregister_object (priv->d_connection,
priv->registration_id);
@@ -732,55 +726,6 @@ miner_progress_cb (TrackerMiner *miner,
emit_dbus_signal (proxy, "Progress", variant);
}
-static void
-on_tracker_store_appeared (GDBusConnection *connection,
- const gchar *name,
- const gchar *name_owner,
- gpointer user_data)
-
-{
- TrackerMinerProxy *proxy = user_data;
- TrackerMinerProxyPrivate *priv = tracker_miner_proxy_get_instance_private (proxy);
-
- g_debug ("Miner:'%s' noticed store availability has changed to AVAILABLE",
- priv->dbus_path);
-
- if (priv->availability_cookie != 0) {
- g_hash_table_remove (priv->pauses,
- GINT_TO_POINTER (priv->availability_cookie));
- sync_miner_pause_state (proxy);
- priv->availability_cookie = 0;
- }
-}
-
-static void
-on_tracker_store_disappeared (GDBusConnection *connection,
- const gchar *name,
- gpointer user_data)
-{
- TrackerMinerProxy *proxy = user_data;
- TrackerMinerProxyPrivate *priv = tracker_miner_proxy_get_instance_private (proxy);
-
- g_debug ("Miner:'%s' noticed store availability has changed to UNAVAILABLE",
- priv->dbus_path);
-
- if (priv->availability_cookie == 0) {
- GError *error = NULL;
- gint cookie_id;
-
- cookie_id = pause_miner (proxy, NULL,
- _("Data store is not available"),
- NULL, &error);
-
- if (error) {
- g_warning ("Could not pause, %s", error->message);
- g_error_free (error);
- } else {
- priv->availability_cookie = cookie_id;
- }
- }
-}
-
static gboolean
tracker_miner_proxy_initable_init (GInitable *initable,
GCancellable *cancellable,
@@ -789,7 +734,6 @@ tracker_miner_proxy_initable_init (GInitable *initable,
TrackerMinerProxy *proxy = TRACKER_MINER_PROXY (initable);
TrackerMinerProxyPrivate *priv = tracker_miner_proxy_get_instance_private (proxy);
GError *inner_error = NULL;
- gchar *store_name;
GDBusInterfaceVTable interface_vtable = {
handle_method_call,
handle_get_property,
@@ -816,23 +760,6 @@ tracker_miner_proxy_initable_init (GInitable *initable,
return FALSE;
}
- if (!tracker_load_domain_config (tracker_sparql_connection_get_domain (),
- &store_name,
- &inner_error)) {
- g_propagate_error (error, inner_error);
- return FALSE;
- }
-
- priv->watch_name_id =
- g_bus_watch_name_on_connection (priv->d_connection,
- store_name,
- G_BUS_NAME_WATCHER_FLAGS_NONE,
- on_tracker_store_appeared,
- on_tracker_store_disappeared,
- proxy,
- NULL);
- g_free (store_name);
-
g_signal_connect (priv->miner, "started",
G_CALLBACK (miner_started_cb), proxy);
g_signal_connect (priv->miner, "stopped",
@@ -844,8 +771,6 @@ tracker_miner_proxy_initable_init (GInitable *initable,
g_signal_connect (priv->miner, "progress",
G_CALLBACK (miner_progress_cb), proxy);
- g_object_unref (domain_ontology);
-
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]