mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-08-24 18:25:50 +00:00
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
This commit is contained in:
parent
4e4cbea644
commit
ee0b2f7910
|
@ -1,3 +1,10 @@
|
|||
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>
|
||||
|
||||
* configure.in:
|
||||
|
|
|
@ -228,7 +228,7 @@ seconds_count_format_time_units (int seconds)
|
|||
|
||||
if (seconds < 60*60) {
|
||||
/* minutes */
|
||||
minutes = (seconds + 30) / 60;
|
||||
minutes = seconds / 60;
|
||||
return minutes;
|
||||
}
|
||||
|
||||
|
@ -236,7 +236,7 @@ seconds_count_format_time_units (int seconds)
|
|||
|
||||
if (seconds < 60*60*4) {
|
||||
/* minutes + hours */
|
||||
minutes = (seconds - hours * 60 * 60 + 30) / 60;
|
||||
minutes = (seconds - hours * 60 * 60) / 60;
|
||||
return minutes + hours;
|
||||
}
|
||||
|
||||
|
@ -260,7 +260,7 @@ format_time (int seconds)
|
|||
}
|
||||
|
||||
if (seconds < 60*60) {
|
||||
minutes = (seconds + 30) / 60;
|
||||
minutes = seconds / 60;
|
||||
return g_strdup_printf (ngettext ("%'d minute", "%'d minutes", minutes), minutes);
|
||||
}
|
||||
|
||||
|
@ -269,7 +269,7 @@ format_time (int seconds)
|
|||
if (seconds < 60*60*4) {
|
||||
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);
|
||||
m = g_strdup_printf (ngettext ("%'d minute", "%'d minutes", minutes), minutes);
|
||||
|
|
Loading…
Reference in a new issue