From f83119ce7ec3d11a903901b8eff762d2b0a9f635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 6 Oct 2013 01:13:40 +0200 Subject: Added file logger --- logic/net/FileDownload.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'logic/net/FileDownload.cpp') diff --git a/logic/net/FileDownload.cpp b/logic/net/FileDownload.cpp index 353fd58b..3f38b0fa 100644 --- a/logic/net/FileDownload.cpp +++ b/logic/net/FileDownload.cpp @@ -2,7 +2,7 @@ #include "FileDownload.h" #include #include -#include +#include FileDownload::FileDownload ( QUrl url, QString target_path ) @@ -28,7 +28,7 @@ void FileDownload::start() // skip this file if they match if ( m_check_md5 && hash == m_expected_md5 ) { - qDebug() << "Skipping " << m_url.toString() << ": md5 match."; + QLOG_INFO() << "Skipping " << m_url.toString() << ": md5 match."; emit succeeded(index_within_job); return; } @@ -43,7 +43,7 @@ void FileDownload::start() return; } - qDebug() << "Downloading " << m_url.toString(); + QLOG_INFO() << "Downloading " << m_url.toString(); QNetworkRequest request ( m_url ); request.setRawHeader(QString("If-None-Match").toLatin1(), m_expected_md5.toLatin1()); request.setHeader(QNetworkRequest::UserAgentHeader,"MultiMC/5.0 (Uncached)"); @@ -51,7 +51,7 @@ void FileDownload::start() auto worker = MMC->qnam(); QNetworkReply * rep = worker->get ( request ); - m_reply = QSharedPointer ( rep, &QObject::deleteLater ); + m_reply = std::shared_ptr ( rep ); connect ( rep, SIGNAL ( downloadProgress ( qint64,qint64 ) ), SLOT ( downloadProgress ( qint64,qint64 ) ) ); connect ( rep, SIGNAL ( finished() ), SLOT ( downloadFinished() ) ); connect ( rep, SIGNAL ( error ( QNetworkReply::NetworkError ) ), SLOT ( downloadError ( QNetworkReply::NetworkError ) ) ); @@ -79,7 +79,7 @@ void FileDownload::downloadFinished() m_status = Job_Finished; m_output_file.close(); - m_reply.clear(); + m_reply.reset(); emit succeeded(index_within_job); return; } @@ -87,7 +87,7 @@ void FileDownload::downloadFinished() else { m_output_file.close(); - m_reply.clear(); + m_reply.reset(); emit failed(index_within_job); return; } -- cgit v1.2.3