]> spindle.queued.net Git - midori/commitdiff
Fix bogus speed display by removing old values
authorChristian Dywan <christian@twotoasts.de>
Sun, 9 Sep 2012 18:55:12 +0000 (20:55 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sun, 9 Sep 2012 20:34:33 +0000 (22:34 +0200)
midori/midori-download.vala
toolbars/midori-transferbar.c

index ee44a9d6ac29d9ad37615fc67ea8d933f62e6fb7..ce9003c31f49ad13e2f03e820716e604fb830eee 100644 (file)
@@ -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");
index 76e2c8e0d3b7ab258725e86d50075ce3113f33e3..81ad85a54f7d70f93767d9d20cee45a1d5f5a19a 100644 (file)
@@ -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