[tracker/tracker-0.10] tracker-miner-fs: Use CancelTasks method in tracker-extract



commit ada83ac8fcd3e1ce4bc2e1cbbb9cb20455b0a616
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Jun 3 14:58:49 2011 +0200

    tracker-miner-fs: Use CancelTasks method in tracker-extract

 src/miners/fs/tracker-miner-files.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/src/miners/fs/tracker-miner-files.c b/src/miners/fs/tracker-miner-files.c
index b063b5c..d962a8d 100644
--- a/src/miners/fs/tracker-miner-files.c
+++ b/src/miners/fs/tracker-miner-files.c
@@ -244,6 +244,8 @@ static void        miner_files_in_removable_media_remove_by_date  (TrackerMinerF
 static void        miner_files_add_removable_or_optical_directory (TrackerMinerFiles *mf,
                                                                    const gchar       *mount_path,
                                                                    const gchar       *uuid);
+static void        extractor_cancel_tasks                         (GDBusConnection   *connection,
+                                                                   GFile             *prefix);
 
 static GInitableIface* miner_files_initable_parent_iface;
 
@@ -1147,6 +1149,9 @@ mount_point_removed_cb (TrackerStorage *storage,
 
 	mount_point_file = g_file_new_for_path (mount_point);
 
+	/* Notify extractor about cancellation of all tasks under the mount point */
+	extractor_cancel_tasks (miner->private->connection, mount_point_file);
+
 	/* Set mount point status in tracker-store */
 	set_up_mount_point (miner, urn, mount_point, NULL, FALSE, NULL);
 
@@ -2362,6 +2367,29 @@ extractor_get_embedded_metadata (ProcessFileData *data,
 }
 
 static void
+extractor_cancel_tasks (GDBusConnection *connection,
+                        GFile           *prefix)
+{
+	GDBusMessage *message;
+	gchar *uris[2];
+
+	uris[0] = g_file_get_uri (prefix);
+	uris[1] = NULL;
+
+	message = g_dbus_message_new_method_call (DBUS_SERVICE_EXTRACT,
+	                                          DBUS_PATH_EXTRACT,
+	                                          DBUS_INTERFACE_EXTRACT,
+	                                          "CancelTasks");
+
+	g_dbus_message_set_body (message, g_variant_new ("(^as)", uris));
+	g_dbus_connection_send_message (connection, message,
+	                                G_DBUS_SEND_MESSAGE_FLAGS_NONE,
+	                                NULL, NULL);
+
+	g_free (uris[0]);
+}
+
+static void
 process_file_cb (GObject      *object,
                  GAsyncResult *result,
                  gpointer      user_data)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]