mirror-chatterino2/src/util/NetworkManager.cpp

25 lines
502 B
C++
Raw Normal View History

2018-06-26 14:09:39 +02:00
#include "util/NetworkManager.hpp"
#include <QNetworkAccessManager>
namespace chatterino {
namespace util {
QThread NetworkManager::workerThread;
QNetworkAccessManager NetworkManager::NaM;
void NetworkManager::init()
{
NetworkManager::NaM.moveToThread(&NetworkManager::workerThread);
NetworkManager::workerThread.start();
}
void NetworkManager::deinit()
{
NetworkManager::workerThread.quit();
NetworkManager::workerThread.wait();
}
} // namespace util
} // namespace chatterino