diff options
author | Martin Wehner <martin.wehner@gmail.com> | 2005-02-27 14:50:03 +0000 |
---|---|---|
committer | Martin Wehner <mwehner@src.gnome.org> | 2005-02-27 14:50:03 +0000 |
commit | 804f56e668fc93a5339d2a06c649c54689293c64 (patch) | |
tree | 5478886153d9140e8661d0604e321c7847cd7119 /libnautilus-private | |
parent | a628dbd3592b3119cda461f9db9898b8559b2571 (diff) | |
download | nautilus-804f56e668fc93a5339d2a06c649c54689293c64.tar.gz |
Don't show ETA if bytes_copied > bytes_total. Prevents miscalculated ETAs
2005-02-27 Martin Wehner <martin.wehner@gmail.com>
* libnautilus-private/nautilus-file-operations-progress.c:
(time_remaining_callback):
Don't show ETA if bytes_copied > bytes_total.
Prevents miscalculated ETAs from being shown. (#158614)
Based on a patch from John Spray <jcs116@york.ac.uk>
Diffstat (limited to 'libnautilus-private')
-rw-r--r-- | libnautilus-private/nautilus-file-operations-progress.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libnautilus-private/nautilus-file-operations-progress.c b/libnautilus-private/nautilus-file-operations-progress.c index f0b4e205c..1384278d0 100644 --- a/libnautilus-private/nautilus-file-operations-progress.c +++ b/libnautilus-private/nautilus-file-operations-progress.c @@ -398,7 +398,13 @@ time_remaining_callback (gpointer callback_data) time_remaining = (progress->details->bytes_total - progress->details->bytes_copied) / transfer_rate; - if (time_remaining >= 3600) { + if (progress->details->bytes_copied > progress->details->bytes_total) { + /* This shouldn't be neccessary, but gnome-vfs seems to add the bytes processed during + * the cleanup phase to bytes_copied. So we try avoid showing unrealistic ETAs here. + */ + str = g_strdup_printf ("%s", " "); + } + else if (time_remaining >= 3600) { str = g_strdup_printf (_("(%d:%02d:%d Remaining)"), time_remaining / 3600, (time_remaining % 3600) / 60, (time_remaining % 3600) % 60); |