Merge lp:~gero-bare/midori/midori-bug-1187085 into lp:midori

Proposed by Gero.Bare
Status: Merged
Approved by: Cris Dywan
Approved revision: 6838
Merged at revision: 6838
Proposed branch: lp:~gero-bare/midori/midori-bug-1187085
Merge into: lp:midori
Diff against target: 20 lines (+8/-2)
1 file modified
midori/midori-download.vala (+8/-2)
To merge this branch: bzr merge lp:~gero-bare/midori/midori-bug-1187085
Reviewer Review Type Date Requested Status
Cris Dywan Approve
Review via email: mp+242288@code.launchpad.net

Commit message

Handle current_size and last_size of Download being equal

Description of the change

This bug was caused because current_size and last_size were equal. Now check, if that's the case restore previous speed LoL.

To post a comment you must log in.
Revision history for this message
Cris Dywan (kalikiana) wrote :

Nice!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'midori/midori-download.vala'
--- midori/midori-download.vala 2014-07-11 05:49:56 +0000
+++ midori/midori-download.vala 2014-11-20 00:59:27 +0000
@@ -102,8 +102,14 @@
102 string speed = "";102 string speed = "";
103 uint64? last_size = download.get_data<uint64?> ("last-size");103 uint64? last_size = download.get_data<uint64?> ("last-size");
104 if (last_size != null && elapsed != last_time) {104 if (last_size != null && elapsed != last_time) {
105 speed = format_size ((uint64)(105 if (current_size != last_size) {
106 (current_size - last_size) / (elapsed - last_time)));106 speed = format_size ((uint64)(
107 (current_size - last_size) / (elapsed - last_time)));
108 download.set_data ("last-speed", speed.dup ());
109 }
110 else {
111 speed = download.get_data ("last-speed");
112 }
107 }113 }
108 else114 else
109 /* i18n: Unknown number of bytes, used for transfer rate like ?B/s */115 /* i18n: Unknown number of bytes, used for transfer rate like ?B/s */

Subscribers

People subscribed via source and target branches

to all changes: