summaryrefslogtreecommitdiffstats
path: root/logic/net/CacheDownload.cpp
diff options
context:
space:
mode:
authorJan Dalheimer <jan@dalheimer.de>2013-12-16 21:17:50 +0100
committerJan Dalheimer <jan@dalheimer.de>2013-12-16 21:17:50 +0100
commit47bf7fff27665496bc4212bcaccc80350f665f97 (patch)
tree878fd220464c5280fcbe589d3ed738ce0306ab2a /logic/net/CacheDownload.cpp
parentae68adc3a536525990b0668703fd74eded8ccfde (diff)
parentdff00a6d2abb84a93e48ff00dda16444550d859f (diff)
downloadMultiMC-47bf7fff27665496bc4212bcaccc80350f665f97.tar
MultiMC-47bf7fff27665496bc4212bcaccc80350f665f97.tar.gz
MultiMC-47bf7fff27665496bc4212bcaccc80350f665f97.tar.lz
MultiMC-47bf7fff27665496bc4212bcaccc80350f665f97.tar.xz
MultiMC-47bf7fff27665496bc4212bcaccc80350f665f97.zip
Merge remote-tracking branch 'upstream/develop' into updater_tests
Conflicts: mmc_updater/src/tests/CMakeLists.txt
Diffstat (limited to 'logic/net/CacheDownload.cpp')
-rw-r--r--logic/net/CacheDownload.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/logic/net/CacheDownload.cpp b/logic/net/CacheDownload.cpp
index 873d3a2e..6eadae39 100644
--- a/logic/net/CacheDownload.cpp
+++ b/logic/net/CacheDownload.cpp
@@ -35,14 +35,14 @@ void CacheDownload::start()
{
if (!m_entry->stale)
{
- emit succeeded(index_within_job);
+ emit succeeded(m_index_within_job);
return;
}
m_output_file.setFileName(m_target_path);
// if there already is a file and md5 checking is in effect and it can be opened
if (!ensureFilePathExists(m_target_path))
{
- emit failed(index_within_job);
+ emit failed(m_index_within_job);
return;
}
QLOG_INFO() << "Downloading " << m_url.toString();
@@ -69,7 +69,9 @@ void CacheDownload::start()
void CacheDownload::downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
{
- emit progress(index_within_job, bytesReceived, bytesTotal);
+ m_total_progress = bytesTotal;
+ m_progress = bytesReceived;
+ emit progress(m_index_within_job, bytesReceived, bytesTotal);
}
void CacheDownload::downloadError(QNetworkReply::NetworkError error)
@@ -116,7 +118,7 @@ void CacheDownload::downloadFinished()
MMC->metacache()->updateEntry(m_entry);
m_reply.reset();
- emit succeeded(index_within_job);
+ emit succeeded(m_index_within_job);
return;
}
// else the download failed
@@ -125,7 +127,7 @@ void CacheDownload::downloadFinished()
m_output_file.close();
m_output_file.remove();
m_reply.reset();
- emit failed(index_within_job);
+ emit failed(m_index_within_job);
return;
}
}
@@ -140,7 +142,7 @@ void CacheDownload::downloadReadyRead()
* Can't open the file... the job failed
*/
m_reply->abort();
- emit failed(index_within_job);
+ emit failed(m_index_within_job);
return;
}
}