From 49da17badd863b0ec4facf7b605a4a9afbe86c2f Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sun, 9 Sep 2012 20:55:12 +0200 Subject: [PATCH] Fix bogus speed display by removing old values --- midori/midori-download.vala | 6 ++++-- toolbars/midori-transferbar.c | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) 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 -- 2.39.5