[snappy] duration: don't display hours if it is zero
- From: Luis de Bethencourt <luisbg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [snappy] duration: don't display hours if it is zero
- Date: Wed, 12 Dec 2012 17:54:40 +0000 (UTC)
commit b0a6c6ed118d6280ebec53c8672d7d1d8af7afde
Author: Alban Crequy <alban crequy collabora co uk>
Date: Wed Dec 12 16:00:04 2012 +0000
duration: don't display hours if it is zero
src/user_interface.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/user_interface.c b/src/user_interface.c
index d188d4b..22d59ac 100644
--- a/src/user_interface.c
+++ b/src/user_interface.c
@@ -727,7 +727,10 @@ position_ns_to_str (gint64 nanoseconds)
minutes = seconds / SEC_IN_MIN;
seconds = seconds - (minutes * SEC_IN_MIN);
- return g_strdup_printf ("%d:%02d:%02ld", hours, minutes, seconds);
+ if (hours >= 1)
+ return g_strdup_printf ("%d:%02d:%02ld", hours, minutes, seconds);
+ else
+ return g_strdup_printf ("%02d:%02ld", minutes, seconds);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]