X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fsessionthread.h;h=98f6a50c2fde006df64a39415fcc34b08b74f0e1;hp=9639f684abf17576553aa53c6f3182c832d80480;hb=8961f348947fc55cc4bc769563684af3f2ea7ccc;hpb=4a5065255e652dd0c301bac0db41b7afb777ef49 diff --git a/src/core/sessionthread.h b/src/core/sessionthread.h index 9639f684..98f6a50c 100644 --- a/src/core/sessionthread.h +++ b/src/core/sessionthread.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2013 by the Quassel Project * + * Copyright (C) 2005-2019 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -18,57 +18,45 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef SESSIONTHREAD_H -#define SESSIONTHREAD_H +#pragma once + +#include -#include #include #include "types.h" class CoreSession; -class InternalConnection; -class RemoteConnection; -class QIODevice; +class Peer; +class InternalPeer; +class RemotePeer; -class SessionThread : public QThread +class SessionThread : public QObject { Q_OBJECT public: - SessionThread(UserId user, bool restoreState, QObject *parent = 0); - ~SessionThread(); - - void run(); - - CoreSession *session(); - UserId user(); + SessionThread(UserId user, bool restoreState, bool strictIdentEnabled, QObject* parent = nullptr); + ~SessionThread() override; public slots: - void addClient(QObject *peer); + void addClient(Peer* peer); + void shutdown(); private slots: - void setSessionInitialized(); + void onSessionInitialized(); + void onSessionDestroyed(); signals: void initialized(); - void shutdown(); + void shutdownSession(); + void shutdownComplete(SessionThread*); - void addRemoteClient(RemoteConnection *); - void addInternalClient(InternalConnection *); + void addClientToWorker(Peer* peer); private: - CoreSession *_session; - UserId _user; - QList clientQueue; - bool _sessionInitialized; - bool _restoreState; + QThread _sessionThread; + bool _sessionInitialized{false}; - bool isSessionInitialized(); - void addClientToSession(QObject *peer); - void addRemoteClientToSession(RemoteConnection *connection); - void addInternalClientToSession(InternalConnection *client); + std::vector _clientQueue; }; - - -#endif