[tracker/miner-fs-refactor: 125/127] libtracker-miner: Handle directories with IGNORED flag being removed
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/miner-fs-refactor: 125/127] libtracker-miner: Handle directories with IGNORED flag being removed
- Date: Mon, 5 Dec 2011 13:30:06 +0000 (UTC)
commit 93e92084045d16f7c1fe5661a40e1dd918b4268e
Author: Carlos Garnacho <carlos lanedo com>
Date: Mon Dec 5 12:43:20 2011 +0100
libtracker-miner: Handle directories with IGNORED flag being removed
In this case, the directory could be reindexed if it's in another indexed
location.
src/libtracker-miner/tracker-file-notifier.c | 30 ++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c
index 7256ca9..0c4d7a5 100644
--- a/src/libtracker-miner/tracker-file-notifier.c
+++ b/src/libtracker-miner/tracker-file-notifier.c
@@ -1010,6 +1010,36 @@ indexing_tree_directory_removed (TrackerIndexingTree *indexing_tree,
/* Flags are still valid at the moment of deletion */
tracker_indexing_tree_get_root (indexing_tree, directory, &flags);
+ /* If the folder was being ignored, index/crawl it from scratch */
+ if (flags & TRACKER_DIRECTORY_FLAG_IGNORE) {
+ GFile *parent;
+
+ parent = g_file_get_parent (directory);
+
+ if (parent) {
+ TrackerDirectoryFlags parent_flags;
+
+ tracker_indexing_tree_get_root (indexing_tree,
+ parent,
+ &parent_flags);
+
+ if (parent_flags & TRACKER_DIRECTORY_FLAG_RECURSE) {
+ priv->pending_index_roots =
+ g_list_append (priv->pending_index_roots,
+ g_object_ref (directory));
+
+ crawl_directories_start (notifier);
+ } else if (tracker_indexing_tree_file_is_root (indexing_tree,
+ parent)) {
+ g_signal_emit (notifier, signals[FILE_CREATED],
+ 0, directory);
+ }
+
+ g_object_unref (parent);
+ }
+ return;
+ }
+
if ((flags & TRACKER_DIRECTORY_FLAG_PRESERVE) == 0) {
/* Directory needs to be deleted from the store too */
g_signal_emit (notifier, signals[FILE_DELETED], 0, directory);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]