From 6892c11e9f287dcfb1e698f8f46233a01fb7abb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sat, 7 Sep 2013 04:00:58 +0200 Subject: Move a good chunk of the singleton objects into a new QApplication subclass. --- logic/net/NetWorker.cpp | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 logic/net/NetWorker.cpp (limited to 'logic/net/NetWorker.cpp') diff --git a/logic/net/NetWorker.cpp b/logic/net/NetWorker.cpp deleted file mode 100644 index c5943348..00000000 --- a/logic/net/NetWorker.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "NetWorker.h" -#include - -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 storage; - if (!storage.hasLocalData()) - { - storage.setLocalData(new NetWorker()); - } - return *storage.localData(); -} -- cgit v1.2.3