diff options
| author | Tannin <devnull@localhost> | 2013-08-30 20:59:12 +0200 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2013-08-30 20:59:12 +0200 |
| commit | 9c31cfa915f71adee8579aa97c12b64903ec9446 (patch) | |
| tree | 63f1b92b8a596df17849f1c5d2ee7e911d879a61 /src/downloadmanager.cpp | |
| parent | 91dd38cb292035b5ca23c531f0383bb283c8700e (diff) | |
- the download manager now registers download speed. Right now this is only used
to display an average speed on the settings menu
- added a python27.dll compiled with vc100. This can now be bundled without introducing more dependencies
- bugfix: extracting now stops after an error
- bugfix: the way hook.dll caused CREATE_ALWAYS/CREATE_NEW to always write into overwrite could lead to the
file being created when the call should have failed (because the file existed and was protected)
- bugfix: GetPrivateProfileString does NOT properly report files as missing. This means that
the ini-query optimization could optimize away requests that should work
- bugfix: fomod installer couldn't display images because they were unpacked to the wrong temporary location
- bugfix: When disabling local saves and choosing to delete the saves nothing happened
- bugfix: the python plugin couldn't find the pyqt libraries
Diffstat (limited to 'src/downloadmanager.cpp')
| -rw-r--r-- | src/downloadmanager.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index ca6744aa..8c2615ea 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -283,6 +283,7 @@ bool DownloadManager::addDownload(const QStringList &URLs, return addDownload(m_NexusInterface->getAccessManager()->get(request), URLs, fileName, modID, fileID, nexusInfo); } + bool DownloadManager::addDownload(QNetworkReply *reply, const QStringList &URLs, const QString &fileName, int modID, int fileID, const NexusInfo &nexusInfo) { @@ -1034,6 +1035,8 @@ void DownloadManager::nxmDownloadURLsAvailable(int modID, int fileID, QVariant u std::sort(resultList.begin(), resultList.end(), boost::bind(&DownloadManager::ServerByPreference, m_PreferredServers, _1, _2)); + info.m_DownloadMap = resultList; + QStringList URLs; foreach (const QVariant &server, resultList) { @@ -1121,6 +1124,17 @@ void DownloadManager::downloadFinished() createMetaFile(info); emit update(index); } else { + + QString url = info->m_Urls[info->m_CurrentUrl]; + foreach (const QVariant &server, info->m_NexusInfo.m_DownloadMap) { + 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 / deltaTime); + break; + } + } + setState(info, STATE_FETCHINGMODINFO); // need to set this state before changing the file name, otherwise .unfinished is appended QString newName = getFileNameFromNetworkReply(reply); |
