mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
fixed it
This commit is contained in:
parent
2b4fa8071f
commit
4716894027
|
@ -5,11 +5,14 @@
|
||||||
#include "QThreadPool"
|
#include "QThreadPool"
|
||||||
#include "QRunnable"
|
#include "QRunnable"
|
||||||
#include "lambdaqrunnable.h"
|
#include "lambdaqrunnable.h"
|
||||||
|
#include "qcoreapplication.h"
|
||||||
|
|
||||||
IrcConnection* IrcManager::connection = NULL;
|
IrcConnection* IrcManager::connection = NULL;
|
||||||
QMutex* IrcManager::connectionMutex = new QMutex();
|
QMutex* IrcManager::connectionMutex = new QMutex();
|
||||||
long IrcManager::connectionIteration = 0;
|
long IrcManager::connectionIteration = 0;
|
||||||
|
|
||||||
|
QObject* IrcManager::parent = new QObject();
|
||||||
|
|
||||||
IrcManager::IrcManager()
|
IrcManager::IrcManager()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -41,7 +44,7 @@ void IrcManager::beginConnecting()
|
||||||
c->setUserName("justinfan123");
|
c->setUserName("justinfan123");
|
||||||
c->setNickName("justinfan123");
|
c->setNickName("justinfan123");
|
||||||
c->setRealName("justinfan123");
|
c->setRealName("justinfan123");
|
||||||
c->sendRaw("JOIN #hsdogdog");
|
c->sendRaw("JOIN #fourtf");
|
||||||
|
|
||||||
c->sendCommand(IrcCommand::createCapability("REQ", "twitch.tv/commands"));
|
c->sendCommand(IrcCommand::createCapability("REQ", "twitch.tv/commands"));
|
||||||
c->sendCommand(IrcCommand::createCapability("REQ", "twitch.tv/tags"));
|
c->sendCommand(IrcCommand::createCapability("REQ", "twitch.tv/tags"));
|
||||||
|
@ -50,6 +53,8 @@ void IrcManager::beginConnecting()
|
||||||
|
|
||||||
connectionMutex->lock();
|
connectionMutex->lock();
|
||||||
if (iteration == connectionIteration) {
|
if (iteration == connectionIteration) {
|
||||||
|
delete connection;
|
||||||
|
c->moveToThread(QCoreApplication::instance()->thread());
|
||||||
connection = c;
|
connection = c;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -17,6 +17,8 @@ private:
|
||||||
|
|
||||||
static void beginConnecting();
|
static void beginConnecting();
|
||||||
|
|
||||||
|
static QObject* parent;
|
||||||
|
|
||||||
static IrcConnection* connection;
|
static IrcConnection* connection;
|
||||||
static QMutex* connectionMutex;
|
static QMutex* connectionMutex;
|
||||||
static long connectionIteration;
|
static long connectionIteration;
|
||||||
|
|
Loading…
Reference in a new issue