[tracker] tracker-control: Clean up store progress reporting
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] tracker-control: Clean up store progress reporting
- Date: Mon, 13 Jun 2011 15:17:21 +0000 (UTC)
commit 6e21cd15fdaf41bfe4830ffa8f0dd92cbc1cdebb
Author: Martyn Russell <martyn lanedo com>
Date: Mon Jun 13 15:56:01 2011 +0100
tracker-control: Clean up store progress reporting
Make it more consistent with the miner reporting.
Also don't represent 0% with a â?? (i.e. done)
src/tracker-control/tracker-control-status.c | 26 +++++++++++++++++---------
1 files changed, 17 insertions(+), 9 deletions(-)
---
diff --git a/src/tracker-control/tracker-control-status.c b/src/tracker-control/tracker-control-status.c
index 7891473..42a2a92 100644
--- a/src/tracker-control/tracker-control-status.c
+++ b/src/tracker-control/tracker-control-status.c
@@ -258,8 +258,8 @@ store_print_state (const gchar *status,
status_split = g_strsplit (status, "-", 2);
if (status_split[0] && status_split[1]) {
- operation = status_split[0];
- operation_status = status_split[1];
+ operation = g_strstrip (status_split[0]);
+ operation_status = g_strstrip (status_split[1]);
/* Free the array, not the contents */
g_free (status_split);
} else {
@@ -268,27 +268,35 @@ store_print_state (const gchar *status,
}
}
- if (progress > 0.0 && progress < 1.0) {
- progress_str = g_strdup_printf ("%-3.0f%%", progress * 100);
+ if (progress >= 0.0 && progress < 1.0) {
+ progress_str = g_strdup_printf ("%3u%%", (guint)(progress * 100));
} else {
progress_str = g_strdup_printf ("â?? ");
}
- g_print ("%s %s %-*.*s %s %s\n",
+ g_print ("%s %s %-*.*s - %s %s%s%s\n",
time_str,
progress_str ? progress_str : " ",
longest_miner_name_length + paused_length,
longest_miner_name_length + paused_length,
- (operation ? _(operation) : _(status)),
- operation_status ? "-" : "",
- operation_status ? _(operation_status) : "");
+ "Store",
+ /*(operation ? _(operation) : _(status)),*/
+ /*operation ? "-" : "",*/
+ operation ? _(operation) : _(status),
+ operation_status ? "(" : "",
+ operation_status ? operation_status : "",
+ operation_status ? ")" : "");
g_free (progress_str);
g_free (operation);
g_free (operation_status);
} else {
- g_print ("%s %s\n",
+ g_print ("%s %s %-*.*s - %s\n",
time_str,
+ "â?? ", /* Progress */
+ longest_miner_name_length + paused_length,
+ longest_miner_name_length + paused_length,
+ "Store",
_("Unavailable"));
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]