[tracker] libtracker-miner: Make sure "Processing..." is 2% or higher in progress
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-miner: Make sure "Processing..." is 2% or higher in progress
- Date: Mon, 13 Jun 2011 15:17:26 +0000 (UTC)
commit 724f01f9b70068f5d6ca6b42c6f00e67055d361a
Author: Martyn Russell <martyn lanedo com>
Date: Mon Jun 13 15:58:25 2011 +0100
libtracker-miner: Make sure "Processing..." is 2% or higher in progress
Before it was possible to still be 1% (which is usually reserved for
crawling) while processing the items we have in our queues.
Also, don't have tigher conditions for when we can issue "Processing..."
src/libtracker-miner/tracker-miner-fs.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index b8e850f..4550bd4 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -2755,17 +2755,20 @@ item_queue_handlers_cb (gpointer user_data)
items_processed,
items_remaining);
+ /* CLAMP progress so it doesn't go back below
+ * 2% (which we use for crawling)
+ */
if (g_strcmp0 (status, "Processingâ?¦") != 0) {
/* Don't spam this */
tracker_info ("Processingâ?¦");
g_object_set (fs,
"status", "Processingâ?¦",
- "progress", progress_now,
+ "progress", CLAMP (progress_now, 0.02, 1.00),
"remaining-time", remaining_time,
NULL);
} else {
g_object_set (fs,
- "progress", progress_now,
+ "progress", CLAMP (progress_now, 0.02, 1.00),
"remaining-time", remaining_time,
NULL);
}
@@ -2777,7 +2780,6 @@ item_queue_handlers_cb (gpointer user_data)
(gint) (progress_last * 100) != (gint) (progress_now * 100)) {
gchar *str1, *str2;
-
info_last = 0;
progress_last = progress_now;
@@ -2914,11 +2916,15 @@ item_queue_handlers_set_up (TrackerMinerFS *fs)
if (!fs->priv->is_crawling) {
gchar *status;
+ gdouble progress;
- g_object_get (fs, "status", &status, NULL);
+ g_object_get (fs,
+ "progress", &progress,
+ "status", &status,
+ NULL);
- if (g_strcmp0 (status, "Processingâ?¦") != 0) {
- /* Don't spam this */
+ /* Don't spam this */
+ if (progress > 0.01 && g_strcmp0 (status, "Processingâ?¦") != 0) {
tracker_info ("Processingâ?¦");
g_object_set (fs, "status", "Processingâ?¦", NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]