[tracker/collation-gconf-locale: 10/20] tracker-status: Change tracker-store reporting to avoid the Journal Replay message always



commit 65a230e4f66880bdf02fe9c91c78830c83434da3
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Mon Nov 15 19:38:12 2010 +0100

    tracker-status: Change tracker-store reporting to avoid the Journal Replay message always

 src/tracker-utils/tracker-status.c |   25 ++++++++++++++++++++++---
 1 files changed, 22 insertions(+), 3 deletions(-)
---
diff --git a/src/tracker-utils/tracker-status.c b/src/tracker-utils/tracker-status.c
index 7d9aa81..fece49e 100644
--- a/src/tracker-utils/tracker-status.c
+++ b/src/tracker-utils/tracker-status.c
@@ -307,6 +307,8 @@ store_print_state (void)
 	GError *error = NULL;
 	gdouble progress;
 	gchar *status;
+	gchar *operation = NULL;
+	gchar *operation_status = NULL;
 	gchar time_str[64];
 	gchar *progress_str;
 
@@ -324,6 +326,21 @@ store_print_state (void)
 		return;
 	}
 
+	if (status && strstr (status, "-")) {
+		gchar **status_split;
+
+		status_split = g_strsplit (status, "-", 2);
+		if (status_split[0] && status_split[1]) {
+			operation = status_split[0];
+			operation_status = status_split[1];
+			/* Free the array, not the contents */
+			g_free (status_split);
+		} else {
+			/* Free everything */
+			g_strfreev (status_split);
+		}
+	}
+
 	if (detailed) {
 		struct tm *local_time;
 		time_t now;
@@ -351,11 +368,13 @@ store_print_state (void)
 	         progress_str,
 	         longest_miner_name_length + paused_length,
 	         longest_miner_name_length + paused_length,
-	         _("Journal replay"),
-	         status ? "-" : "",
-	         status ? _(status) : "");
+	         operation ? _(operation) : _(status),
+	         operation_status ? "-" : "",
+	         operation_status ? _(operation_status) : "");
 
 	g_free (progress_str);
+	g_free (operation);
+	g_free (operation_status);
 }
 
 static void



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