[tracker/tracker-0.10] tracker-miner-fs: Do not spam log on recursive monitors removal



commit caa4ca3920014e36c117f473b3c35a66059be22e
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed May 25 12:05:50 2011 +0200

    tracker-miner-fs: Do not spam log on recursive monitors removal
    
    This part is known to work well, no need to spew a line for each dir
    monitor removed.

 src/libtracker-miner/tracker-monitor.c |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-monitor.c b/src/libtracker-miner/tracker-monitor.c
index 310b08d..798d738 100644
--- a/src/libtracker-miner/tracker-monitor.c
+++ b/src/libtracker-miner/tracker-monitor.c
@@ -1464,35 +1464,34 @@ tracker_monitor_remove_recursively (TrackerMonitor *monitor,
 	GHashTableIter iter;
 	gpointer iter_file, iter_file_monitor;
 	guint items_removed = 0;
+	gchar *uri;
 
 	g_return_val_if_fail (TRACKER_IS_MONITOR (monitor), FALSE);
 	g_return_val_if_fail (G_IS_FILE (file), FALSE);
 
 	g_hash_table_iter_init (&iter, monitor->priv->monitors);
 	while (g_hash_table_iter_next (&iter, &iter_file, &iter_file_monitor)) {
-		gchar *uri;
-
 		if (!g_file_has_prefix (iter_file, file) &&
 		    !g_file_equal (iter_file, file)) {
 			continue;
 		}
 
-		uri = g_file_get_uri (iter_file);
-
 		g_hash_table_iter_remove (&iter);
+		items_removed++;
+	}
 
-		g_debug ("Removed monitor for path:'%s', total monitors:%d",
-		         uri,
-		         g_hash_table_size (monitor->priv->monitors));
-
-		g_free (uri);
+	uri = g_file_get_uri (file);
+	g_debug ("Removed all monitors recursively for path:'%s', total monitors:%d",
+		 uri, g_hash_table_size (monitor->priv->monitors));
+	g_free (uri);
 
+	if (items_removed > 0) {
 		/* We reset this because now it is possible we have limit - 1 */
 		monitor->priv->monitor_limit_warned = FALSE;
-		items_removed++;
+		return TRUE;
 	}
 
-	return items_removed > 0;
+	return FALSE;
 }
 
 static gboolean



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