summaryrefslogtreecommitdiffstats
path: root/logic/net/CacheDownload.cpp
diff options
context:
space:
mode:
authorSky <git@bunnies.cc>2013-10-06 01:13:20 +0100
committerSky <git@bunnies.cc>2013-10-06 01:13:20 +0100
commit7aeea14a027f8cf28615f73f4fda1ffffc2cdc3c (patch)
tree53ea703d11a525442d6ebf575bd22f840c5b4e8d /logic/net/CacheDownload.cpp
parent2398acc9e490ce124aa621c19156c89ef87591f1 (diff)
parentf83119ce7ec3d11a903901b8eff762d2b0a9f635 (diff)
downloadMultiMC-7aeea14a027f8cf28615f73f4fda1ffffc2cdc3c.tar
MultiMC-7aeea14a027f8cf28615f73f4fda1ffffc2cdc3c.tar.gz
MultiMC-7aeea14a027f8cf28615f73f4fda1ffffc2cdc3c.tar.lz
MultiMC-7aeea14a027f8cf28615f73f4fda1ffffc2cdc3c.tar.xz
MultiMC-7aeea14a027f8cf28615f73f4fda1ffffc2cdc3c.zip
Merge branch 'develop' of https://github.com/MultiMC/MultiMC5 into develop
Diffstat (limited to 'logic/net/CacheDownload.cpp')
-rw-r--r--logic/net/CacheDownload.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/logic/net/CacheDownload.cpp b/logic/net/CacheDownload.cpp
index 9fc1f127..0e653e05 100644
--- a/logic/net/CacheDownload.cpp
+++ b/logic/net/CacheDownload.cpp
@@ -5,7 +5,7 @@
#include <QCryptographicHash>
#include <QFileInfo>
#include <QDateTime>
-#include <QDebug>
+#include <logger/QsLog.h>
CacheDownload::CacheDownload(QUrl url, MetaEntryPtr entry)
: Download(), md5sum(QCryptographicHash::Md5)
@@ -31,7 +31,7 @@ void CacheDownload::start()
emit failed(index_within_job);
return;
}
- qDebug() << "Downloading " << m_url.toString();
+ QLOG_INFO() << "Downloading " << m_url.toString();
QNetworkRequest request(m_url);
request.setRawHeader(QString("If-None-Match").toLatin1(), m_entry->etag.toLatin1());
request.setHeader(QNetworkRequest::UserAgentHeader,"MultiMC/5.0 (Cached)");
@@ -39,7 +39,7 @@ void CacheDownload::start()
auto worker = MMC->qnam();
QNetworkReply *rep = worker->get(request);
- m_reply = QSharedPointer<QNetworkReply>(rep, &QObject::deleteLater);
+ m_reply = std::shared_ptr<QNetworkReply>(rep);
connect(rep, SIGNAL(downloadProgress(qint64, qint64)),
SLOT(downloadProgress(qint64, qint64)));
connect(rep, SIGNAL(finished()), SLOT(downloadFinished()));
@@ -92,7 +92,7 @@ void CacheDownload::downloadFinished()
m_entry->stale = false;
MMC->metacache()->updateEntry(m_entry);
- m_reply.clear();
+ m_reply.reset();
emit succeeded(index_within_job);
return;
}
@@ -101,7 +101,7 @@ void CacheDownload::downloadFinished()
{
m_output_file.close();
m_output_file.remove();
- m_reply.clear();
+ m_reply.reset();
emit failed(index_within_job);
return;
}