[tracker/tracker-0.10] 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/tracker-0.10] libtracker-miner: Make sure "Processing..." is 2% or higher in progress
- Date: Thu, 16 Jun 2011 16:10:24 +0000 (UTC)
commit 75dcdbbfec2d3240fadd17839e53fff8a2f2ecac
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 | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index d2ae82e..2571111 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -2751,16 +2751,19 @@ item_queue_handlers_cb (gpointer user_data)
g_object_get (fs, "status", &status, NULL);
+ /* 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),
NULL);
} else {
g_object_set (fs,
- "progress", progress_now,
+ "progress", CLAMP (progress_now, 0.02, 1.00),
NULL);
}
@@ -2909,11 +2912,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]