summaryrefslogtreecommitdiffstats
path: root/api/logic/net
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-11-06 21:58:54 +0100
committerPetr Mrázek <peterix@gmail.com>2016-11-06 21:58:54 +0100
commit8b952b387041341f556edcf0bb34576a2fc88568 (patch)
tree804b8976355ef3950628647370e7dfc1bdf96b4f /api/logic/net
parent37cc59c04d0573a42d67242135495c0a0729f965 (diff)
downloadMultiMC-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/net')
-rw-r--r--api/logic/net/Download.cpp3
-rw-r--r--api/logic/net/PasteUpload.cpp3
2 files changed, 2 insertions, 4 deletions
diff --git a/api/logic/net/Download.cpp b/api/logic/net/Download.cpp
index 3d53ded0..af0b3144 100644
--- a/api/logic/net/Download.cpp
+++ b/api/logic/net/Download.cpp
@@ -95,8 +95,7 @@ void Download::start()
request.setHeader(QNetworkRequest::UserAgentHeader, "MultiMC/5.0");
- 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)));
diff --git a/api/logic/net/PasteUpload.cpp b/api/logic/net/PasteUpload.cpp
index 4b671d6f..a03a4c64 100644
--- a/api/logic/net/PasteUpload.cpp
+++ b/api/logic/net/PasteUpload.cpp
@@ -36,8 +36,7 @@ void PasteUpload::executeTask()
request.setRawHeader("Content-Type", "application/x-www-form-urlencoded");
request.setRawHeader("Content-Length", QByteArray::number(m_text.size()));
- auto worker = ENV.qnam();
- QNetworkReply *rep = worker->post(request, buf);
+ QNetworkReply *rep = ENV.qnam().post(request, buf);
m_reply = std::shared_ptr<QNetworkReply>(rep);
setStatus(tr("Uploading to paste.ee"));