diff options
author | portix <none@none> | 2012-07-30 00:21:56 +0200 |
---|---|---|
committer | portix <none@none> | 2012-07-30 00:21:56 +0200 |
commit | 14fc7d64d0333092e85bedbeffca89df323099eb (patch) | |
tree | a9cfaca66d49465d638e90d63485daf30eaff97d /src | |
parent | bec517ab82bbd7964d52c9e396f8f009aaaac2c1 (diff) | |
download | dwb-14fc7d64d0333092e85bedbeffca89df323099eb.zip |
Fixing download speed in download labels
Diffstat (limited to 'src')
-rw-r--r-- | src/download.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/download.c b/src/download.c index 069a1188..6fd7887b 100644 --- a/src/download.c +++ b/src/download.c @@ -161,8 +161,8 @@ download_progress_cb(WebKitDownload *download, GParamSpec *p, DwbDownloadStatus double current_size = (double)webkit_download_get_current_size(download) / 0x100000; char buffer[128] = {0}; - const char *format = speed > 1 ? "[%.1fM/s|%d:%02d|%2d%%|%.3f/%.3f]" : "[%.3fK/s|%d:%02d|%2d%%|%.3f/%.3f]"; - snprintf(buffer, 128, format, speed, remaining/60, remaining%60, (int)(progress*100), current_size, total_size); + const char *format = speed > 1 ? "[%.1fM/s|%d:%02d|%2d%%|%.3f/%.3f]" : "[%3.1fK/s|%d:%02d|%2d%%|%.3f/%.3f]"; + snprintf(buffer, 128, format, speed > 1 ? speed : speed*1024, remaining/60, remaining%60, (int)(progress*100), current_size, total_size); gtk_label_set_text(GTK_LABEL(label->rlabel), buffer); #if _HAS_GTK3 |