X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fsessionthread.h;h=e36075450d7856ed00755795ded0eabbc88afd77;hp=ee29d2e3dadcaff7c19973b7ff8e8e8cd2309134;hb=e8a39b4c3c92e193ab861a3fea84a261bb6fbd24;hpb=d1b6499b0b848d4287efae89107576548533502c diff --git a/src/core/sessionthread.h b/src/core/sessionthread.h index ee29d2e3..e3607545 100644 --- a/src/core/sessionthread.h +++ b/src/core/sessionthread.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel IRC Team * + * 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,49 +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 SessionThread : public QThread { - Q_OBJECT - - public: - SessionThread(UserId user, QObject *parent = 0); - ~SessionThread(); +class Peer; +class InternalPeer; +class RemotePeer; - void run(); +class SessionThread : public QObject +{ + Q_OBJECT - CoreSession *session(); - UserId user(); +public: + SessionThread(UserId user, bool restoreState, bool strictIdentEnabled, QObject *parent = nullptr); + ~SessionThread() override; - public slots: - void addClient(QIODevice *socket); +public slots: + void addClient(Peer *peer); + void shutdown(); - private slots: - void setSessionInitialized(); +private slots: + void onSessionInitialized(); + void onSessionDestroyed(); - signals: +signals: void initialized(); + void shutdownSession(); + void shutdownComplete(SessionThread *); - private: - CoreSession *_session; - UserId _user; - QList clientQueue; - bool _sessionInitialized; + void addClientToWorker(Peer *peer); - bool isSessionInitialized(); - void addClientToSession(QIODevice *socket); -}; +private: + QThread _sessionThread; + bool _sessionInitialized{false}; -#endif + std::vector _clientQueue; +};