[tracker] libtracker-miner: Don't report processing or percentage change until crawling is finished



commit acce67669cca1ba82d0d6383dad0e9961986ddc1
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Thu Oct 21 15:50:58 2010 +0200

    libtracker-miner: Don't report processing or percentage change until crawling is finished

 src/libtracker-miner/tracker-miner-fs.c |   44 +++++++++++++++++++++++-------
 1 files changed, 33 insertions(+), 11 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 47965b3..d4301e2 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -2407,11 +2407,31 @@ item_queue_handlers_cb (gpointer user_data)
 
 		time_last = time_now;
 
-		/* Update progress */
+		/* Update progress? */
 		progress_now = item_queue_get_progress (fs,
 		                                        &items_processed,
 		                                        &items_remaining);
-		g_object_set (fs, "progress", progress_now, NULL);
+
+		if (!fs->private->is_crawling) {
+			gchar *status;
+
+			g_object_get (fs, "status", &status, NULL);
+
+			if (g_strcmp0 (status, "Processingâ?¦") != 0) {
+				/* Don't spam this */
+				g_message ("Processingâ?¦");
+				g_object_set (fs,
+				              "status", "Processingâ?¦",
+				              "progress", progress_now,
+				              NULL);
+			} else {
+				g_object_set (fs,
+				              "progress", progress_now,
+				              NULL);
+			}
+
+			g_free (status);
+		}
 
 		if (++info_last >= 5 &&
 		    (gint) (progress_last * 100) != (gint) (progress_now * 100)) {
@@ -2505,8 +2525,6 @@ _tracker_idle_add (TrackerMinerFS *fs,
 static void
 item_queue_handlers_set_up (TrackerMinerFS *fs)
 {
-	gchar *status;
-
 	if (fs->private->item_queues_handler_id != 0) {
 		return;
 	}
@@ -2520,15 +2538,19 @@ item_queue_handlers_set_up (TrackerMinerFS *fs)
 		return;
 	}
 
-	g_object_get (fs, "status", &status, NULL);
+	if (!fs->private->is_crawling) {
+		gchar *status;
 
-	if (g_strcmp0 (status, "Processingâ?¦") != 0) {
-		/* Don't spam this */
-		g_message ("Processingâ?¦");
-		g_object_set (fs, "status", "Processingâ?¦", NULL);
-	}
+		g_object_get (fs, "status", &status, NULL);
 
-	g_free (status);
+		if (g_strcmp0 (status, "Processingâ?¦") != 0) {
+			/* Don't spam this */
+			g_message ("Processingâ?¦");
+			g_object_set (fs, "status", "Processingâ?¦", NULL);
+		}
+
+		g_free (status);
+	}
 
 	fs->private->item_queues_handler_id =
 		_tracker_idle_add (fs,



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