[tracker-miners/sam/index-file-sync: 315/316] miner-manager: Update to use FilesProcessed
- From: Sam Thursfield <sthursfield src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/sam/index-file-sync: 315/316] miner-manager: Update to use FilesProcessed
- Date: Mon, 6 Jul 2020 11:24:02 +0000 (UTC)
commit fc88e4a1a565d4a991ca1bd9e6eb1dc5d9550ec6
Author: Sam Thursfield <sam afuera me uk>
Date: Mon May 11 01:26:02 2020 +0200
miner-manager: Update to use FilesProcessed
src/tracker/tracker-miner-manager.c | 49 +++++++++++++++++++++----------------
1 file changed, 28 insertions(+), 21 deletions(-)
---
diff --git a/src/tracker/tracker-miner-manager.c b/src/tracker/tracker-miner-manager.c
index e2fdcf230..b2b69a16a 100644
--- a/src/tracker/tracker-miner-manager.c
+++ b/src/tracker/tracker-miner-manager.c
@@ -64,7 +64,7 @@ struct MinerData {
guint progress_signal;
guint paused_signal;
guint resumed_signal;
- guint file_processed_signal;
+ guint files_processed_signal;
guint watch_name_id;
GObject *manager; /* weak */
};
@@ -424,22 +424,29 @@ miner_resumed (GDBusConnection *connection,
}
static void
-miner_file_processed (GDBusConnection *connection,
- const gchar *sender_name,
- const gchar *object_path,
- const gchar *interface_name,
- const gchar *signal_name,
- GVariant *parameters,
- gpointer user_data)
+miner_files_processed (GDBusConnection *connection,
+ const gchar *sender_name,
+ const gchar *object_path,
+ const gchar *interface_name,
+ const gchar *signal_name,
+ GVariant *parameters,
+ gpointer user_data)
{
MinerData *data = user_data;
+ GVariantIter iter;
+ GVariant *files, *file_info;
const gchar *url = NULL;
gboolean status = FALSE;
const gchar *message = NULL;
- g_variant_get (parameters, "(&sbs)", &url, &status, &message);
- if (data->manager) {
- g_signal_emit (data->manager, signals[MINER_FILE_PROCESSED], 0, data->dbus_name, url, status,
message);
+ files = g_variant_get_child_value (parameters, 0);
+ g_variant_iter_init (&iter, files);
+ while ((file_info = g_variant_iter_next_value (&iter))) {
+ g_variant_get (file_info, "(&sbs)", &url, &status, &message);
+
+ if (data->manager) {
+ g_signal_emit (data->manager, signals[MINER_FILE_PROCESSED], 0, data->dbus_name, url,
status, message);
+ }
}
}
@@ -551,16 +558,16 @@ miner_manager_initable_init (GInitable *initable,
data,
NULL);
- data->file_processed_signal = g_dbus_connection_signal_subscribe (priv->connection,
- data->dbus_name,
-
TRACKER_MINER_DBUS_INTERFACE,
- "FileProcessed",
- data->dbus_path,
- NULL,
- G_DBUS_SIGNAL_FLAGS_NONE,
- miner_file_processed,
- data,
- NULL);
+ data->files_processed_signal = g_dbus_connection_signal_subscribe (priv->connection,
+ data->dbus_name,
+
TRACKER_MINER_DBUS_INTERFACE,
+ "FilesProcessed",
+ data->dbus_path,
+ NULL,
+ G_DBUS_SIGNAL_FLAGS_NONE,
+ miner_files_processed,
+ data,
+ NULL);
g_hash_table_insert (priv->miner_proxies, proxy, g_strdup (data->dbus_name));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]