[tracker/tracker-0.6] Bug NB#131369 - Tries to open files as directories.



commit 33081c5f27e9e0e29a89b8e37cf909f0c21d7009
Author: Carlos Garnacho <carlos lanedo com>
Date:   Wed Oct 14 14:48:55 2009 +0200

    Bug NB#131369 - Tries to open files as directories.
    
    Ensure TrackerProcessor doesn't tell TrackerCrawler to process files.

 src/trackerd/tracker-processor.c |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)
---
diff --git a/src/trackerd/tracker-processor.c b/src/trackerd/tracker-processor.c
index ed076d6..67edd1f 100644
--- a/src/trackerd/tracker-processor.c
+++ b/src/trackerd/tracker-processor.c
@@ -1697,10 +1697,10 @@ processor_files_move (TrackerProcessor *processor,
 			g_queue_push_tail (queue, g_object_ref (other_file));
 
 			item_queue_handlers_set_up (processor);
+		} else {
+			/* If this is a directory we need to crawl it */
+			tracker_crawler_add_unexpected_path (crawler, other_path);
 		}
-
-		/* If this is a directory we need to crawl it */
-		tracker_crawler_add_unexpected_path (crawler, other_path);
 	} else if (other_path_ignored) {
 		/* Delete old file */
 		queue = g_hash_table_lookup (processor->private->items_deleted_queues, module_name);
@@ -1760,17 +1760,19 @@ monitor_item_moved_cb (TrackerMonitor *monitor,
 		       gpointer        user_data)
 {
 	if (!is_source_monitored) {
-		TrackerProcessor *processor;
-		TrackerCrawler   *crawler;
-		gchar            *path;
+		if (is_directory) {
+			TrackerProcessor *processor;
+			TrackerCrawler   *crawler;
+			gchar            *path;
 
-		processor = user_data;
+			processor = user_data;
 
-		/* If the source is not monitored, we need to crawl it. */
-		path = g_file_get_path (other_file);
-		crawler = g_hash_table_lookup (processor->private->crawlers, module_name);
-		tracker_crawler_add_unexpected_path (crawler, path);
-		g_free (path);
+			/* If the source is not monitored, we need to crawl it. */
+			path = g_file_get_path (other_file);
+			crawler = g_hash_table_lookup (processor->private->crawlers, module_name);
+			tracker_crawler_add_unexpected_path (crawler, path);
+			g_free (path);
+		}
 	} else {
 		processor_files_move (user_data, module_name, file, other_file, is_directory);
 	}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]