diff options
author | Petr Mrázek <peterix@gmail.com> | 2016-11-06 21:58:54 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2016-11-06 21:58:54 +0100 |
commit | 8b952b387041341f556edcf0bb34576a2fc88568 (patch) | |
tree | 804b8976355ef3950628647370e7dfc1bdf96b4f /api/logic/minecraft/forge | |
parent | 37cc59c04d0573a42d67242135495c0a0729f965 (diff) | |
download | MultiMC-8b952b387041341f556edcf0bb34576a2fc88568.tar MultiMC-8b952b387041341f556edcf0bb34576a2fc88568.tar.gz MultiMC-8b952b387041341f556edcf0bb34576a2fc88568.tar.lz MultiMC-8b952b387041341f556edcf0bb34576a2fc88568.tar.xz MultiMC-8b952b387041341f556edcf0bb34576a2fc88568.zip |
NOISSUE Refactor and sanitize MultiMC startup/shutdown
* Always create main window.
* Properly handle netowrk manager - it was created twice, leading to potential crashes.
Diffstat (limited to 'api/logic/minecraft/forge')
-rw-r--r-- | api/logic/minecraft/forge/ForgeXzDownload.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/api/logic/minecraft/forge/ForgeXzDownload.cpp b/api/logic/minecraft/forge/ForgeXzDownload.cpp index 8b762866..68e080f2 100644 --- a/api/logic/minecraft/forge/ForgeXzDownload.cpp +++ b/api/logic/minecraft/forge/ForgeXzDownload.cpp @@ -61,15 +61,12 @@ void ForgeXzDownload::start() request.setRawHeader(QString("If-None-Match").toLatin1(), m_entry->getETag().toLatin1()); request.setHeader(QNetworkRequest::UserAgentHeader, "MultiMC/5.0 (Cached)"); - auto worker = ENV.qnam(); - QNetworkReply *rep = worker->get(request); + QNetworkReply *rep = ENV.qnam().get(request); m_reply.reset(rep); - connect(rep, SIGNAL(downloadProgress(qint64, qint64)), - SLOT(downloadProgress(qint64, qint64))); + 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))); + connect(rep, SIGNAL(error(QNetworkReply::NetworkError)), SLOT(downloadError(QNetworkReply::NetworkError))); connect(rep, SIGNAL(readyRead()), SLOT(downloadReadyRead())); } |