[tracker/miner-fs-refactor: 108/110] libtracker-miner, notifier: report again status when crawling



commit 7722e6d2a77cd75c9fd0094d165d33a8e585817d
Author: Carlos Garnacho <carlos lanedo com>
Date:   Fri Oct 21 17:59:43 2011 +0200

    libtracker-miner, notifier: report again status when crawling
    
    This brings back the "Crawling directory '...'" messages reported
    via the Status DBus property.

 src/libtracker-miner/tracker-miner-fs.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 7407784..aa4ee95 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -2578,6 +2578,29 @@ file_notifier_directory_started (TrackerFileNotifier *notifier,
                                  gpointer             user_data)
 {
 	TrackerMinerFS *fs = user_data;
+	TrackerDirectoryFlags flags;
+	gchar *str, *uri;
+
+	uri = g_file_get_uri (directory);
+	tracker_indexing_tree_get_root (fs->priv->indexing_tree,
+					directory, &flags);
+
+	if ((flags & TRACKER_DIRECTORY_FLAG_RECURSE) != 0) {
+                str = g_strdup_printf ("Crawling recursively directory '%s'", uri);
+        } else {
+                str = g_strdup_printf ("Crawling single directory '%s'", uri);
+        }
+
+	/* Always set the progress here to at least 1%, and the remaining time
+         * to -1 as we cannot guess during crawling (we don't know how many directories
+         * we will find) */
+        g_object_set (fs,
+                      "progress", 0.01,
+                      "status", str,
+                      "remaining-time", -1,
+                      NULL);
+	g_free (str);
+	g_free (uri);
 
 	if (!fs->priv->timer) {
 		fs->priv->timer = g_timer_new ();



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