Commit 730c9e6f authored by Carlos Garnacho's avatar Carlos Garnacho

libtracker-miner: Drop tracker_file_notifier_ensure_parents()

This is supposed to happen with MONITOR | !CHECK_TIME. Luckily or
not, !CHECK_MTIME is currently broken (doubly! in handling, and in
setting it), anyhow this flag shouldn't mean "ignore newly found
files/directories", when fixed in future commits.

Drop this, we should really issue ::file-created from the regular
paths.
parent e14dbfa0
......@@ -893,44 +893,6 @@ notifier_queue_root (TrackerFileNotifier *notifier,
notifier_check_next_root (notifier);
}
/* This function ensures to issue ::file-created for all
* parent folders that are not yet indexed. Shouldn't happen
* often, it is however possible if MONITOR | !CHECK_MTIME is
* given, and file updates happen on a not previously indexed
* directory.
*/
static void
tracker_file_notifier_ensure_parents (TrackerFileNotifier *notifier,
GFile *file)
{
TrackerFileNotifierPrivate *priv;
GFile *parent, *canonical;
priv = tracker_file_notifier_get_instance_private (notifier);
parent = g_file_get_parent (file);
while (parent) {
if (tracker_file_notifier_get_file_iri (notifier, parent, TRUE)) {
g_object_unref (parent);
break;
}
canonical = tracker_file_system_get_file (priv->file_system,
parent,
G_FILE_TYPE_DIRECTORY,
NULL);
g_object_unref (parent);
g_signal_emit (notifier, signals[FILE_CREATED], 0, canonical, TRUE);
if (tracker_indexing_tree_file_is_root (priv->indexing_tree, canonical)) {
break;
}
parent = g_file_get_parent (canonical);
}
}
/* Monitor signal handlers */
static void
monitor_item_created_cb (TrackerMonitor *monitor,
......@@ -1016,8 +978,6 @@ monitor_item_created_cb (TrackerMonitor *monitor,
}
}
tracker_file_notifier_ensure_parents (notifier, file);
/* Fetch the interned copy */
canonical = tracker_file_system_get_file (priv->file_system,
file, file_type, NULL);
......@@ -1050,8 +1010,6 @@ monitor_item_updated_cb (TrackerMonitor *monitor,
return;
}
tracker_file_notifier_ensure_parents (notifier, file);
/* Fetch the interned copy */
canonical = tracker_file_system_get_file (priv->file_system,
file, file_type, NULL);
......
......@@ -673,7 +673,6 @@ test_file_notifier_monitor_updates_non_recursive (TestCommonContext *fixture,
{ OPERATION_CREATE, "non-recursive/bbb", NULL }
};
FilesystemOperation expected_results2[] = {
{ OPERATION_CREATE, "non-recursive", NULL },
{ OPERATION_UPDATE, "non-recursive/bbb", NULL },
{ OPERATION_CREATE, "non-recursive/ccc", NULL },
{ OPERATION_UPDATE, "non-recursive/ccc", NULL }
......@@ -722,7 +721,6 @@ test_file_notifier_monitor_updates_recursive (TestCommonContext *fixture,
{ OPERATION_CREATE, "recursive/bbb", NULL }
};
FilesystemOperation expected_results2[] = {
{ OPERATION_CREATE, "recursive", NULL },
{ OPERATION_CREATE, "recursive/folder", NULL },
{ OPERATION_CREATE, "recursive/folder/aaa", NULL },
{ OPERATION_UPDATE, "recursive/bbb", NULL },
......
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