diff options
author | Petr Mrázek <peterix@gmail.com> | 2013-09-02 00:25:40 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2013-09-02 00:25:40 +0200 |
commit | f8e8414d544f1227e86099146bba903c9082d09e (patch) | |
tree | a0983c2a5a17feda4c2f813d32d0b98111463176 /logic/net/NetWorker.cpp | |
parent | 78e278c1e33e39eb29a26a976b19ea6a8150bfff (diff) | |
download | MultiMC-f8e8414d544f1227e86099146bba903c9082d09e.tar MultiMC-f8e8414d544f1227e86099146bba903c9082d09e.tar.gz MultiMC-f8e8414d544f1227e86099146bba903c9082d09e.tar.lz MultiMC-f8e8414d544f1227e86099146bba903c9082d09e.tar.xz MultiMC-f8e8414d544f1227e86099146bba903c9082d09e.zip |
Speed up the downloads. Massively.
Diffstat (limited to 'logic/net/NetWorker.cpp')
-rw-r--r-- | logic/net/NetWorker.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/logic/net/NetWorker.cpp b/logic/net/NetWorker.cpp index 1eef13d9..c5943348 100644 --- a/logic/net/NetWorker.cpp +++ b/logic/net/NetWorker.cpp @@ -1,7 +1,25 @@ #include "NetWorker.h" #include <QThreadStorage> -NetWorker& NetWorker::spawn() +class NetWorker::Private +{ +public: + QNetworkAccessManager manager; +}; + +NetWorker::NetWorker ( QObject* parent ) : QObject ( parent ) +{ + d = new Private(); +} + +QNetworkAccessManager& NetWorker::qnam() +{ + auto & w = worker(); + return w.d->manager; +} + + +NetWorker& NetWorker::worker() { static QThreadStorage<NetWorker *> storage; if (!storage.hasLocalData()) |