X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Fauthhandler.h;h=a2c078a9cfb8fb963929eb6cf31b64f921e566ff;hb=45645a28bdc5b6c1052b3e4cebf8cc80832d205a;hp=d5c54716a8562100ddaba5ab61f790226a6305d4;hpb=39328183a6a87c6eb10a9dbbffcd5d65bf154a1f;p=quassel.git diff --git a/src/common/authhandler.h b/src/common/authhandler.h index d5c54716..a2c078a9 100644 --- a/src/common/authhandler.h +++ b/src/common/authhandler.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2018 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 * @@ -33,36 +33,39 @@ class COMMON_EXPORT AuthHandler : public QObject Q_OBJECT public: - AuthHandler(QObject *parent = nullptr); + AuthHandler(QObject* parent = nullptr); - QTcpSocket *socket() const; + QTcpSocket* socket() const; bool isLocal() const; - virtual void handle(const Protocol::RegisterClient &) { invalidMessage(); } - virtual void handle(const Protocol::ClientDenied &) { invalidMessage(); } - virtual void handle(const Protocol::ClientRegistered &) { invalidMessage(); } - virtual void handle(const Protocol::SetupData &) { invalidMessage(); } - virtual void handle(const Protocol::SetupFailed &) { invalidMessage(); } - virtual void handle(const Protocol::SetupDone &) { invalidMessage(); } - virtual void handle(const Protocol::Login &) { invalidMessage(); } - virtual void handle(const Protocol::LoginFailed &) { invalidMessage(); } - virtual void handle(const Protocol::LoginSuccess &) { invalidMessage(); } - virtual void handle(const Protocol::SessionState &) { invalidMessage(); } + virtual void handle(const Protocol::RegisterClient&) { invalidMessage(); } + virtual void handle(const Protocol::ClientDenied&) { invalidMessage(); } + virtual void handle(const Protocol::ClientRegistered&) { invalidMessage(); } + virtual void handle(const Protocol::SetupData&) { invalidMessage(); } + virtual void handle(const Protocol::SetupFailed&) { invalidMessage(); } + virtual void handle(const Protocol::SetupDone&) { invalidMessage(); } + virtual void handle(const Protocol::Login&) { invalidMessage(); } + virtual void handle(const Protocol::LoginFailed&) { invalidMessage(); } + virtual void handle(const Protocol::LoginSuccess&) { invalidMessage(); } + virtual void handle(const Protocol::SessionState&) { invalidMessage(); } // fallback for unknown types, will trigger an error template - void handle(const T &) { invalidMessage(); } + void handle(const T&) + { + invalidMessage(); + } public slots: void close(); signals: void disconnected(); - void socketError(QAbstractSocket::SocketError error, const QString &errorString); + void socketError(QAbstractSocket::SocketError error, const QString& errorString); protected: - void setSocket(QTcpSocket *socket); + void setSocket(QTcpSocket* socket); protected slots: virtual void onSocketError(QAbstractSocket::SocketError error); @@ -71,6 +74,6 @@ protected slots: private: void invalidMessage(); - QTcpSocket *_socket; // FIXME: should be a QSharedPointer? -> premature disconnect before the peer has taken over - bool _disconnectedSent; + QTcpSocket* _socket{nullptr}; // FIXME: should be a QSharedPointer? -> premature disconnect before the peer has taken over + bool _disconnectedSent{false}; };