[tracker] TrackerMonitor: Only log removals if the dir was monitored.



commit e1c36e7363fdecf24187ac44a4f03cdae80443ef
Author: Carlos Garnacho <carlos lanedo com>
Date:   Mon Mar 1 17:52:26 2010 +0100

    TrackerMonitor: Only log removals if the dir was monitored.

 src/libtracker-miner/tracker-monitor.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-monitor.c b/src/libtracker-miner/tracker-monitor.c
index efd7843..8971272 100644
--- a/src/libtracker-miner/tracker-monitor.c
+++ b/src/libtracker-miner/tracker-monitor.c
@@ -1537,20 +1537,23 @@ gboolean
 tracker_monitor_remove (TrackerMonitor *monitor,
                         GFile          *file)
 {
-	gchar *path;
 	gboolean removed;
 
 	g_return_val_if_fail (TRACKER_IS_MONITOR (monitor), FALSE);
 	g_return_val_if_fail (G_IS_FILE (file), FALSE);
 
 	removed = g_hash_table_remove (monitor->private->monitors, file);
-	path = g_file_get_path (file);
 
-	g_debug ("Removed monitor for path:'%s', total monitors:%d",
-	         path,
-	         g_hash_table_size (monitor->private->monitors));
+	if (removed) {
+		gchar *path;
 
-	g_free (path);
+		path = g_file_get_path (file);
+		g_debug ("Removed monitor for path:'%s', total monitors:%d",
+		         path,
+		         g_hash_table_size (monitor->private->monitors));
+
+		g_free (path);
+	}
 
 	return removed;
 }



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