X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fsessionthread.h;h=e36075450d7856ed00755795ded0eabbc88afd77;hp=c215590f5498771e4782168f6167bd1a35b672f4;hb=e8a39b4c3c92e193ab861a3fea84a261bb6fbd24;hpb=67e4eb295238453c94da41185bcdb20d908859d6 diff --git a/src/core/sessionthread.h b/src/core/sessionthread.h index c215590f..e3607545 100644 --- a/src/core/sessionthread.h +++ b/src/core/sessionthread.h @@ -18,60 +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 Peer; class InternalPeer; class RemotePeer; -class QIODevice; -class SessionThread : public QThread +class SessionThread : public QObject { Q_OBJECT public: - SessionThread(UserId user, bool restoreState, bool strictIdentEnabled, 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(RemotePeer *peer); - void addInternalClient(InternalPeer *peer); + void addClientToWorker(Peer *peer); private: - CoreSession *_session; - UserId _user; - QList clientQueue; - bool _sessionInitialized; - bool _restoreState; - - /// Whether or not strict ident mode is enabled, locking users' idents to Quassel username - bool _strictIdentEnabled; + QThread _sessionThread; + bool _sessionInitialized{false}; - bool isSessionInitialized(); - void addClientToSession(QObject *peer); - void addRemoteClientToSession(RemotePeer *remotePeer); - void addInternalClientToSession(InternalPeer *internalPeer); + std::vector _clientQueue; }; - - -#endif