aboutsummaryrefslogtreecommitdiff
path: root/logic/net/MD5EtagDownload.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/MD5EtagDownload.cpp
parentae68adc3a536525990b0668703fd74eded8ccfde (diff)
parentdff00a6d2abb84a93e48ff00dda16444550d859f (diff)
downloadPrismLauncher-47bf7fff27665496bc4212bcaccc80350f665f97.tar.gz
PrismLauncher-47bf7fff27665496bc4212bcaccc80350f665f97.tar.bz2
PrismLauncher-47bf7fff27665496bc4212bcaccc80350f665f97.zip
Merge remote-tracking branch 'upstream/develop' into updater_tests
Conflicts: mmc_updater/src/tests/CMakeLists.txt
Diffstat (limited to 'logic/net/MD5EtagDownload.cpp')
-rw-r--r--logic/net/MD5EtagDownload.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/logic/net/MD5EtagDownload.cpp b/logic/net/MD5EtagDownload.cpp
index 4b9f52af..435e854e 100644
--- a/logic/net/MD5EtagDownload.cpp
+++ b/logic/net/MD5EtagDownload.cpp
@@ -44,7 +44,7 @@ void MD5EtagDownload::start()
if (m_check_md5 && hash == m_expected_md5)
{
QLOG_INFO() << "Skipping " << m_url.toString() << ": md5 match.";
- emit succeeded(index_within_job);
+ emit succeeded(m_index_within_job);
return;
}
else
@@ -54,7 +54,7 @@ void MD5EtagDownload::start()
}
if (!ensureFilePathExists(filename))
{
- emit failed(index_within_job);
+ emit failed(m_index_within_job);
return;
}
@@ -68,7 +68,7 @@ void MD5EtagDownload::start()
// Plus, this way, we don't end up starting a download for a file we can't open.
if (!m_output_file.open(QIODevice::WriteOnly))
{
- emit failed(index_within_job);
+ emit failed(m_index_within_job);
return;
}
@@ -86,7 +86,9 @@ void MD5EtagDownload::start()
void MD5EtagDownload::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 MD5EtagDownload::downloadError(QNetworkReply::NetworkError error)
@@ -107,7 +109,7 @@ void MD5EtagDownload::downloadFinished()
QLOG_INFO() << "Finished " << m_url.toString() << " got " << m_reply->rawHeader("ETag").constData();
m_reply.reset();
- emit succeeded(index_within_job);
+ emit succeeded(m_index_within_job);
return;
}
// else the download failed
@@ -115,7 +117,7 @@ void MD5EtagDownload::downloadFinished()
{
m_output_file.close();
m_reply.reset();
- emit failed(index_within_job);
+ emit failed(m_index_within_job);
return;
}
}
@@ -130,7 +132,7 @@ void MD5EtagDownload::downloadReadyRead()
* Can't open the file... the job failed
*/
m_reply->abort();
- emit failed(index_within_job);
+ emit failed(m_index_within_job);
return;
}
}