[tracker] Fixes GB#614560, Build problems in the gio file monitoring case



commit 53a72bb4c58ace942a102f1d24732f653f98755f
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Tue Apr 6 14:28:45 2010 +0100

    Fixes GB#614560, Build problems in the gio file monitoring case
    
    Fix 1/2 - use same _monitor_move() function for inotify/gio

 src/libtracker-miner/tracker-monitor.c |   36 ++++++++++++++++---------------
 1 files changed, 19 insertions(+), 17 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-monitor.c b/src/libtracker-miner/tracker-monitor.c
index 99585c8..bb641f5 100644
--- a/src/libtracker-miner/tracker-monitor.c
+++ b/src/libtracker-miner/tracker-monitor.c
@@ -540,22 +540,12 @@ event_data_free (gpointer data)
 	g_slice_free (EventData, data);
 }
 
-#ifdef HAVE_LIBINOTIFY
-
-static void
-event_data_update (EventData *event)
-{
-	GTimeVal now;
-
-	g_get_current_time (&now);
-
-	event->last_time = now;
-}
 
+/* Note: used both when compiling with and without libinotify support */
 static gboolean
-libinotify_monitor_move (TrackerMonitor *monitor,
-                         GFile          *old_file,
-                         GFile          *new_file)
+tracker_monitor_move (TrackerMonitor *monitor,
+                      GFile          *old_file,
+                      GFile          *new_file)
 {
 	GHashTableIter iter;
 	GHashTable *new_monitors;
@@ -645,6 +635,18 @@ libinotify_monitor_move (TrackerMonitor *monitor,
 	return items_moved > 0;
 }
 
+#ifdef HAVE_LIBINOTIFY
+
+static void
+event_data_update (EventData *event)
+{
+	GTimeVal now;
+
+	g_get_current_time (&now);
+
+	event->last_time = now;
+}
+
 static gchar *
 libinotify_monitor_event_to_string (guint32 event_type)
 {
@@ -1224,7 +1226,7 @@ libinotify_monitor_event_cb (INotifyHandle *handle,
 			               TRUE);
 
 			if (is_directory) {
-				libinotify_monitor_move (monitor, file, other_file);
+				tracker_monitor_move (monitor, file, other_file);
 			}
 
 			g_hash_table_remove (monitor->private->event_pairs,
@@ -1289,7 +1291,7 @@ libinotify_monitor_event_cb (INotifyHandle *handle,
 			               is_source_indexed);
 
 			if (is_directory) {
-				libinotify_monitor_move (monitor, other_file, file);
+				tracker_monitor_move (monitor, other_file, file);
 			}
 
 			g_hash_table_remove (monitor->private->event_pairs,
@@ -1580,7 +1582,7 @@ monitor_event_cb (GFileMonitor	    *file_monitor,
 			       TRUE);
 
 		if (is_directory) {
-			libinotify_monitor_move (monitor, file, other_file);
+			tracker_monitor_move (monitor, file, other_file);
 		}
 
 		break;



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