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

libtracker-miner: Allow to invalidate files iri recursively

This will be useful for delete operations.
parent 38b4d19a
......@@ -1782,9 +1782,24 @@ tracker_file_notifier_get_file_iri (TrackerFileNotifier *notifier,
return iri;
}
static gboolean
file_notifier_invalidate_file_iri_foreach (GFile *file,
gpointer user_data)
{
TrackerFileSystem *file_system = user_data;
tracker_file_system_set_property (file_system,
file,
quark_property_iri,
NULL);
return FALSE;
}
void
tracker_file_notifier_invalidate_file_iri (TrackerFileNotifier *notifier,
GFile *file)
GFile *file,
gboolean recursive)
{
TrackerFileNotifierPrivate *priv;
GFile *canonical;
......@@ -1801,11 +1816,21 @@ tracker_file_notifier_invalidate_file_iri (TrackerFileNotifier *notifier,
return;
}
/* Set a NULL iri, so we make sure to look it up afterwards */
tracker_file_system_set_property (priv->file_system,
canonical,
quark_property_iri,
NULL);
if (!recursive) {
/* Set a NULL iri, so we make sure to look it up afterwards */
tracker_file_system_set_property (priv->file_system,
canonical,
quark_property_iri,
NULL);
return;
}
tracker_file_system_traverse (priv->file_system,
canonical,
G_PRE_ORDER,
file_notifier_invalidate_file_iri_foreach,
-1,
priv->file_system);
}
GFileType
......
......@@ -91,7 +91,8 @@ const gchar * tracker_file_notifier_get_file_iri (TrackerFileNotifier *notif
gboolean force);
void tracker_file_notifier_invalidate_file_iri (TrackerFileNotifier *notifier,
GFile *file);
GFile *file,
gboolean recursive);
GFileType tracker_file_notifier_get_file_type (TrackerFileNotifier *notifier,
GFile *file);
......
......@@ -1335,7 +1335,7 @@ 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);
tracker_file_notifier_invalidate_file_iri (priv->file_notifier, task_file, FALSE);
if (item_queue_is_blocked_by_file (fs, task_file)) {
g_object_unref (priv->item_queue_blocker);
......
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