mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
f51372102e
* rename ImageLoader* to Network* * static NetworkManager * NetworkManager queue arbitrary requests * modify urlfetch to use NetworkManager * urlfetchjson in terms of NetworkManager * fetchurljson fetchurltimeout fetchurljsontimeout special fetch url functions with various connects and functions to be called * operate on fetched data in the correct thread * operate on fetched resources in correct thread * networkmanager urlfetch functions * expose urlfetch functions of networkmanager through util and util::twitch * add caller to util functions * cleanup * formatting * urlPut function for NetworkManager and util::twitch * cleanup worker (no more leak) * use urlfetch for LazyLoadedImage::loadImage * Rename NetworkManager methods (#1) * Rename NetworkManager methods Remove unused NetworkManager methods Remove unused NetworkManager includes Reorder includes in lazyloadedimage.cpp and urlfetch.hpp * try to simplify code, might break everything * fixed some more stuff?
25 lines
502 B
C++
25 lines
502 B
C++
#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
|