X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fsessionthread.h;h=e36075450d7856ed00755795ded0eabbc88afd77;hp=810e858300939de769f18f82f1681c819866c569;hb=c194ed5fb3d15e14b9364f9796d3521910dc72fe;hpb=f824db0e31b54969e0b7fa0b5405b1e9173d482c diff --git a/src/core/sessionthread.h b/src/core/sessionthread.h index 810e8583..e3607545 100644 --- a/src/core/sessionthread.h +++ b/src/core/sessionthread.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-09 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -15,57 +15,48 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 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 QIODevice; -class SignalProxy; +class Peer; +class InternalPeer; +class RemotePeer; -class SessionThread : public QThread { - Q_OBJECT +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 initialized(); + void shutdownSession(); + void shutdownComplete(SessionThread *); - void addRemoteClient(QIODevice *); - void addInternalClient(SignalProxy *); + 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(QIODevice *socket); - void addInternalClientToSession(SignalProxy *proxy); + std::vector _clientQueue; }; - -#endif