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
1 changed files with 4 additions and 0 deletions

View File

@ -49,6 +49,10 @@ namespace Midori {
format_size (download.current_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;
double elapsed = download.get_elapsed_time (),
diff = elapsed / current_size,