Paste P287

Masterwork From Distant Lands
ActivePublic

Authored by davidedmundson on Jan 9 2019, 12:08 PM.
diff --git a/src/core/slaveinterface.cpp b/src/core/slaveinterface.cpp
index 6eb2b08d..d79b498d 100644
--- a/src/core/slaveinterface.cpp
+++ b/src/core/slaveinterface.cpp
@@ -103,7 +103,9 @@ void SlaveInterface::calcSpeed()
// using first and last item from the list.
const qint64 elapsed_time = d->elapsed_timer.elapsed();
- if (elapsed_time >= 900) {
+ const qint64 last_time = d->transfer_details.isEmpty() ? 0 : d->transfer_details.last().time;
+
+ if (elapsed_time - last_time >= 900) {
if (d->transfer_details.count() == max_count) {
d->transfer_details.removeFirst();
}
davidedmundson edited the content of this paste. (Show Details)Jan 9 2019, 12:08 PM
davidedmundson changed the title of this paste from untitled to Masterwork From Distant Lands.