Commit ee0b2f79 authored by Cosimo Cecchi's avatar Cosimo Cecchi Committed by Cosimo Cecchi

don't add 30 seconds when formatting time, as float->int conversion

2009-02-22  Cosimo Cecchi  <cosimoc@gnome.org>

	* libnautilus-private/nautilus-file-operations.c
	(seconds_count_format_time_units), (format_time):
	don't add 30 seconds when formatting time, as float->int conversion
	already truncates the value for us (#572284).

svn path=/trunk/; revision=14991
parent 4e4cbea6
2009-02-22 Cosimo Cecchi <cosimoc@gnome.org>
* libnautilus-private/nautilus-file-operations.c
(seconds_count_format_time_units), (format_time):
don't add 30 seconds when formatting time, as float->int conversion
already truncates the value for us (#572284).
2009-02-21 Cosimo Cecchi <cosimoc@gnome.org> 2009-02-21 Cosimo Cecchi <cosimoc@gnome.org>
* configure.in: * configure.in:
......
...@@ -228,7 +228,7 @@ seconds_count_format_time_units (int seconds) ...@@ -228,7 +228,7 @@ seconds_count_format_time_units (int seconds)
if (seconds < 60*60) { if (seconds < 60*60) {
/* minutes */ /* minutes */
minutes = (seconds + 30) / 60; minutes = seconds / 60;
return minutes; return minutes;
} }
...@@ -236,7 +236,7 @@ seconds_count_format_time_units (int seconds) ...@@ -236,7 +236,7 @@ seconds_count_format_time_units (int seconds)
if (seconds < 60*60*4) { if (seconds < 60*60*4) {
/* minutes + hours */ /* minutes + hours */
minutes = (seconds - hours * 60 * 60 + 30) / 60; minutes = (seconds - hours * 60 * 60) / 60;
return minutes + hours; return minutes + hours;
} }
...@@ -260,7 +260,7 @@ format_time (int seconds) ...@@ -260,7 +260,7 @@ format_time (int seconds)
} }
if (seconds < 60*60) { if (seconds < 60*60) {
minutes = (seconds + 30) / 60; minutes = seconds / 60;
return g_strdup_printf (ngettext ("%'d minute", "%'d minutes", minutes), minutes); return g_strdup_printf (ngettext ("%'d minute", "%'d minutes", minutes), minutes);
} }
...@@ -269,7 +269,7 @@ format_time (int seconds) ...@@ -269,7 +269,7 @@ format_time (int seconds)
if (seconds < 60*60*4) { if (seconds < 60*60*4) {
char *h, *m; char *h, *m;
minutes = (seconds - hours * 60 * 60 + 30) / 60; minutes = (seconds - hours * 60 * 60) / 60;
h = g_strdup_printf (ngettext ("%'d hour", "%'d hours", hours), hours); h = g_strdup_printf (ngettext ("%'d hour", "%'d hours", hours), hours);
m = g_strdup_printf (ngettext ("%'d minute", "%'d minutes", minutes), minutes); m = g_strdup_printf (ngettext ("%'d minute", "%'d minutes", minutes), minutes);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment