summaryrefslogtreecommitdiff
path: root/src/downloadmanager.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2013-09-02 18:51:17 +0200
committerTannin <devnull@localhost>2013-09-02 18:51:17 +0200
commit0fa7155eb831dbc16fe0609f83c2755bb2b5dc24 (patch)
treec81897533cd5485ecbf457f71b78847b6a4aca0e /src/downloadmanager.cpp
parentc6c61ce7920897d1e3e34088ee48d9f24b0dd7ec (diff)
- bugfix: division-by-zero error in the newly introduced server-speed calculation
- bugfix: temp files extracted during fomod installation were not cleaned up. This still doesn't remove directories - bugfix: fomod installer didn't find the installer xmls because they are in a subdirectory since release 0.99.4
Diffstat (limited to 'src/downloadmanager.cpp')
-rw-r--r--src/downloadmanager.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp
index 97a0a266..c8f118f6 100644
--- a/src/downloadmanager.cpp
+++ b/src/downloadmanager.cpp
@@ -1150,7 +1150,9 @@ void DownloadManager::downloadFinished()
QVariantMap serverMap = server.toMap();
if (serverMap["URI"].toString() == url) {
int deltaTime = info->m_StartTime.secsTo(QTime::currentTime());
- emit downloadSpeed(serverMap["Name"].toString(), (info->m_TotalSize - info->m_PreResumeSize) / deltaTime);
+ if (deltaTime > 5) {
+ emit downloadSpeed(serverMap["Name"].toString(), (info->m_TotalSize - info->m_PreResumeSize) / deltaTime);
+ } // no division by zero please! Also, if the download is shorter than a few seconds, the result is way to inprecise
break;
}
}