Networkmanager (#134)

* 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?
This commit is contained in:
hemirt
2017-10-27 20:09:02 +02:00
committed by pajlada
parent a4c0bdb926
commit f51372102e
17 changed files with 521 additions and 427 deletions
+8
View File
@@ -7,6 +7,8 @@
#include <QStandardPaths>
#include <pajlada/settings/settingmanager.hpp>
#include "util/networkmanager.hpp"
#ifdef USEWINSDK
#include "windows.h"
#endif
@@ -88,6 +90,9 @@ int main(int argc, char *argv[])
return 1;
}
// Initialize NetworkManager
chatterino::util::NetworkManager::init();
int ret = 0;
{
@@ -103,5 +108,8 @@ int main(int argc, char *argv[])
// Save settings
pajlada::Settings::SettingManager::save();
// Deinitialize NetworkManager (stop thread and wait for finish, should be instant)
chatterino::util::NetworkManager::deinit();
return ret;
}