tracker r2917 - in trunk: . src/tracker-indexer



Author: carlosg
Date: Wed Feb 11 13:13:32 2009
New Revision: 2917
URL: http://svn.gnome.org/viewvc/tracker?rev=2917&view=rev

Log:
2009-02-11  Carlos Garnacho  <carlos imendio com>

        * src/tracker-indexer/tracker-indexer.c (item_move): And add back that
        recurse boolean parameter to the function, looks like commit r2892 to
        tracker-indexer.c wiped out the previous commit.

Modified:
   trunk/ChangeLog
   trunk/src/tracker-indexer/tracker-indexer.c

Modified: trunk/src/tracker-indexer/tracker-indexer.c
==============================================================================
--- trunk/src/tracker-indexer/tracker-indexer.c	(original)
+++ trunk/src/tracker-indexer/tracker-indexer.c	Wed Feb 11 13:13:32 2009
@@ -208,7 +208,8 @@
 static void     item_remove            (TrackerIndexer      *indexer,
 					PathInfo	    *info,
 					const gchar         *dirname,
-					const gchar         *basename);
+					const gchar         *basename,
+					gboolean             recurse);
 
 
 static guint signals[LAST_SIGNAL] = { 0, };
@@ -1775,7 +1776,7 @@
 		g_message ("Destination file '%s' already existed in database, removing", path);
 
 		tracker_file_get_path_and_name (path, &dest_dirname, &dest_basename);
-		item_remove (indexer, info, dest_dirname, dest_basename);
+		item_remove (indexer, info, dest_dirname, dest_basename, TRUE);
 
 		g_free (dest_dirname);
 		g_free (dest_basename);
@@ -1838,7 +1839,8 @@
 item_remove (TrackerIndexer *indexer,
 	     PathInfo	    *info,
 	     const gchar    *dirname,
-	     const gchar    *basename)
+	     const gchar    *basename,
+	     gboolean        recurse)
 {
 	TrackerService *service;
 	TrackerDataMetadata *data_metadata;
@@ -1945,7 +1947,7 @@
 	tracker_data_update_delete_service (service, service_id);
 	tracker_data_update_delete_all_metadata (service, service_id);
 
-	if (strcmp (service_type, "Folders") == 0) {
+	if (recurse && strcmp (service_type, "Folders") == 0) {
 		tracker_data_update_delete_service_recursively (service, path);
 	}
 
@@ -2366,7 +2368,11 @@
 			item_add_or_update (indexer, info, dirname, basename, metadata);
 			g_object_unref (metadata);
 		} else {
-			item_remove (indexer, info, dirname, basename);
+			/* Delete events are not atomic, so we don't recurse
+			 * here, since we'll have probably got already events
+			 * from children
+			 */
+			item_remove (indexer, info, dirname, basename, FALSE);
 		}
 	}
 



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