[tracker/tracker-0.6] Fixes NB#129415, Checked] [REGF] Video and Audio Library view and ...



commit 0511a33da72db802654d98413040ae1e318e8ee9
Author: Martyn Russell <martyn imendio com>
Date:   Thu Aug 13 12:59:01 2009 +0100

    Fixes NB#129415, Checked] [REGF] Video and Audio Library view and ...
    
    This was caused by Microsoft Windows NOT setting the parent folder
    mtime when it changes a child file. On Linux we can count on this. On
    Windows we can not. So now we check in ALL cases for EVERY folder if
    we have any stale children in the database and we remove them if
    that's the case.

 src/tracker-indexer/tracker-indexer.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/tracker-indexer/tracker-indexer.c b/src/tracker-indexer/tracker-indexer.c
index 3da24e6..47b1769 100644
--- a/src/tracker-indexer/tracker-indexer.c
+++ b/src/tracker-indexer/tracker-indexer.c
@@ -1614,14 +1614,14 @@ remove_stale_children (TrackerIndexer *indexer,
 	TrackerDBInterface *iface;
 	gchar **children;
 	PathInfo *info;
-	gint i;
+	gint found, i;
 
 	iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
 							     TRACKER_DB_CONTENT_TYPE_METADATA);
 
 	children = tracker_data_search_files_get (iface, path);
 
-	for (i = 0; children[i]; i++) {
+	for (i = 0, found = 0; children[i]; i++) {
 		GFile *file;
 
 		file = g_file_new_for_path (children[i]);
@@ -1630,11 +1630,16 @@ remove_stale_children (TrackerIndexer *indexer,
 			/* File doesn't exist, check for deletion */
 			info = path_info_new (parent_info->module, file, NULL, TRUE);
 			add_file (indexer, info);
+
+			found++;
 		}
 
 		g_object_unref (file);
 	}
 
+	g_message ("'%s' checked for stale children, found:%d", 
+		   path, found);
+
 	g_strfreev (children);
 }
 
@@ -2621,6 +2626,11 @@ should_change_index_for_file (TrackerIndexer *indexer,
 		return TRUE;
 	}
 
+	/* If the service is a folder, we check it for stale children */
+	if (strcmp (tracker_service_get_name (service), "Folders") == 0) {
+		return TRUE;
+	}
+
 	/* So, if we are here, then the file or directory DID exist
 	 * in the database already. Now we need to check if the
 	 * parent directory mtime matches the mtime we have for it in



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