2018-06-26 15:33:51 +02:00
|
|
|
#include "common/NetworkManager.hpp"
|
2017-10-27 20:09:02 +02:00
|
|
|
|
|
|
|
#include <QNetworkAccessManager>
|
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
|
|
|
|
QThread NetworkManager::workerThread;
|
2018-08-10 19:00:14 +02:00
|
|
|
QNetworkAccessManager NetworkManager::accessManager;
|
2017-10-27 20:09:02 +02:00
|
|
|
|
|
|
|
void NetworkManager::init()
|
|
|
|
{
|
2018-08-10 19:00:14 +02:00
|
|
|
NetworkManager::accessManager.moveToThread(&NetworkManager::workerThread);
|
2017-10-27 20:09:02 +02:00
|
|
|
NetworkManager::workerThread.start();
|
|
|
|
}
|
|
|
|
|
|
|
|
void NetworkManager::deinit()
|
|
|
|
{
|
|
|
|
NetworkManager::workerThread.quit();
|
|
|
|
NetworkManager::workerThread.wait();
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace chatterino
|