From: Christian Dywan Date: Sun, 9 Sep 2012 18:55:12 +0000 (+0200) Subject: Fix bogus speed display by removing old values X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49da17badd863b0ec4facf7b605a4a9afbe86c2f;p=midori Fix bogus speed display by removing old values --- diff --git a/midori/midori-download.vala b/midori/midori-download.vala index ee44a9d6..ce9003c3 100644 --- a/midori/midori-download.vala +++ b/midori/midori-download.vala @@ -83,8 +83,10 @@ namespace Midori { } string speed; - if (elapsed != last_time) - speed = format_size ((int)((current_size - last_size) / (elapsed - last_time))); + if (elapsed != last_time) { + speed = format_size ((uint64)( + (current_size - last_size) / (elapsed - last_time))); + } else /* i18n: Unknown number of bytes, used for transfer rate like ?B/s */ speed = _("?B"); diff --git a/toolbars/midori-transferbar.c b/toolbars/midori-transferbar.c index 76e2c8e0..81ad85a5 100644 --- a/toolbars/midori-transferbar.c +++ b/toolbars/midori-transferbar.c @@ -213,8 +213,6 @@ midori_transferbar_add_download_item (MidoriTransferbar* transferbar, G_CALLBACK (midori_transferbar_download_notify_status_cb), info); g_signal_connect (button, "clicked", G_CALLBACK (midori_transferbar_download_button_clicked_cb), info); - g_object_set_data_full (G_OBJECT (download), "last-time", g_new0 (gdouble, 1), g_free); - g_object_set_data_full (G_OBJECT (download), "last-size", g_new0 (guint64, 1), g_free); } static void