No speed or remaining time for finished transfers

This commit is contained in:
Christian Dywan 2012-09-09 20:52:36 +02:00
parent ad99fb1ebb
commit c8b6e07f27

View file

@ -49,6 +49,10 @@ namespace Midori {
format_size (download.current_size), format_size (download.current_size),
format_size (download.total_size)); format_size (download.total_size));
/* Finished, no speed or remaining time */
if (is_finished (download) || download.status == WebKit.DownloadStatus.CREATED)
return "%s\n%s".printf (filename, size);
uint64 total_size = download.total_size, current_size = download.current_size; uint64 total_size = download.total_size, current_size = download.current_size;
double elapsed = download.get_elapsed_time (), double elapsed = download.get_elapsed_time (),
diff = elapsed / current_size, diff = elapsed / current_size,