[tracker/miner-fs-refactor: 46/101] libtracker-miner: Remove check for removed files during crawling
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/miner-fs-refactor: 46/101] libtracker-miner: Remove check for removed files during crawling
- Date: Thu, 20 Oct 2011 12:19:26 +0000 (UTC)
commit 0d369588fd0be16d823951f125650e823b0ea36e
Author: Carlos Garnacho <carlos lanedo com>
Date: Thu Sep 29 16:55:11 2011 +0200
libtracker-miner: Remove check for removed files during crawling
This code is unused now, TrackerFileNotifier will issue ::file-deleted
already for items found in the store but not during crawling.
src/libtracker-miner/tracker-miner-fs.c | 61 -------------------------------
1 files changed, 0 insertions(+), 61 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 9d1f7b1..0a43818 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -224,9 +224,6 @@ struct _TrackerMinerFSPrivate {
GList *dirs_without_parent;
- /* Files to check if no longer exist */
- GHashTable *check_removed;
-
TrackerIndexingTree *indexing_tree;
/* Config directories where we should force mtime checking, regardless of
@@ -819,11 +816,6 @@ tracker_miner_fs_init (TrackerMinerFS *object)
(GDestroyNotify) g_object_unref,
(GDestroyNotify) g_free);
- priv->check_removed = g_hash_table_new_full (g_file_hash,
- (GEqualFunc) g_file_equal,
- (GDestroyNotify) g_object_unref,
- NULL);
-
priv->mtime_checking = TRUE;
priv->initial_crawling = TRUE;
priv->dirs_without_parent = NULL;
@@ -947,10 +939,6 @@ fs_finalize (GObject *object)
g_hash_table_unref (priv->iri_cache);
}
- if (priv->check_removed) {
- g_hash_table_unref (priv->check_removed);
- }
-
g_object_unref (priv->indexing_tree);
#ifdef EVENT_QUEUE_ENABLE_TRACE
@@ -3206,42 +3194,6 @@ item_queue_handlers_set_up (TrackerMinerFS *fs)
}
static gboolean
-remove_unexisting_file_cb (gpointer key,
- gpointer value,
- gpointer user_data)
-{
- TrackerMinerFS *fs = user_data;
- GFile *file = key;
-
- /* If file no longer exists, remove it from the store */
- if (!g_file_query_exists (file, NULL)) {
- gchar *uri;
-
- uri = g_file_get_uri (file);
- g_debug (" Marking file which no longer exists in FS for removal: %s", uri);
- g_free (uri);
-
- trace_eq_push_tail ("DELETED", file, "No longer exists");
- tracker_priority_queue_add (fs->priv->items_deleted,
- g_object_ref (file),
- G_PRIORITY_LOW);
-
- item_queue_handlers_set_up (fs);
- }
-
- return TRUE;
-}
-
-static void
-check_if_files_removed (TrackerMinerFS *fs)
-{
- g_debug ("Checking if any file was removed...");
- g_hash_table_foreach_remove (fs->priv->check_removed,
- remove_unexisting_file_cb,
- fs);
-}
-
-static gboolean
should_change_index_for_file (TrackerMinerFS *fs,
GFile *file)
{
@@ -3251,9 +3203,6 @@ should_change_index_for_file (TrackerMinerFS *fs,
struct tm t;
gchar *time_str, *lookup_time = "";
- /* Remove the file from the list of files to be checked if removed */
- g_hash_table_remove (fs->priv->check_removed, file);
-
file_info = g_file_query_info (file,
G_FILE_ATTRIBUTE_TIME_MODIFIED,
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
@@ -3880,16 +3829,6 @@ crawler_finished_cb (TrackerCrawler *crawler,
directory_data_unref (fs->priv->current_directory);
fs->priv->current_directory = NULL;
- if (!was_interrupted) {
- /* Check if any file was left after whole crawling */
- check_if_files_removed (fs);
- } else {
- /* Ditch files to check for removal, as the crawler was
- * interrupted, it can lead to false positives.
- */
- g_hash_table_remove_all (fs->priv->check_removed);
- }
-
/* Proceed to next thing to process */
crawl_directories_start (fs);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]