Commit a1ac15cc authored by Haithem BEN GHORBAL's avatar Haithem BEN GHORBAL Committed by Carlos Garnacho

libtracker-miner: Invalidate files iri recursively in case of file removal

Directories must get all children invalidated, because already queued tasks
might contain new instances of those same files, in which case they would
still find the previous URN.
parent de017390
......@@ -201,6 +201,7 @@ struct _TrackerMinerFSPrivate {
/* File properties */
GQuark quark_ignore_file;
GQuark quark_recursive_removal;
GQuark quark_attribute_updated;
GQuark quark_directory_found_crawling;
GQuark quark_reentry_counter;
......@@ -718,6 +719,7 @@ tracker_miner_fs_init (TrackerMinerFS *object)
G_CALLBACK (task_pool_limit_reached_notify_cb), object);
priv->quark_ignore_file = g_quark_from_static_string ("tracker-ignore-file");
priv->quark_recursive_removal = g_quark_from_static_string ("tracker-recursive-removal");
priv->quark_directory_found_crawling = g_quark_from_static_string ("tracker-directory-found-crawling");
priv->quark_attribute_updated = g_quark_from_static_string ("tracker-attribute-updated");
priv->quark_reentry_counter = g_quark_from_static_string ("tracker-reentry-counter");
......@@ -1319,6 +1321,7 @@ sparql_buffer_task_finished_cb (GObject *object,
TrackerMinerFSPrivate *priv;
TrackerTask *task;
GFile *task_file;
gboolean recursive;
GError *error = NULL;
fs = user_data;
......@@ -1335,7 +1338,9 @@ sparql_buffer_task_finished_cb (GObject *object,
task_file = tracker_task_get_file (task);
tracker_file_notifier_invalidate_file_iri (priv->file_notifier, task_file, FALSE);
recursive = GPOINTER_TO_INT (g_object_steal_qdata (G_OBJECT (task_file),
priv->quark_recursive_removal));
tracker_file_notifier_invalidate_file_iri (priv->file_notifier, task_file, recursive);
if (item_queue_is_blocked_by_file (fs, task_file)) {
g_object_unref (priv->item_queue_blocker);
......@@ -1636,6 +1641,10 @@ item_remove (TrackerMinerFS *fs,
#endif
}
g_object_set_qdata (G_OBJECT (file),
fs->priv->quark_recursive_removal,
GINT_TO_POINTER (TRUE));
builder = tracker_sparql_builder_new_update ();
g_signal_emit (fs, signals[REMOVE_FILE], 0,
file, only_children, builder, &delete_handled);
......
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