Replace Protocol::Handler enum with enum class
authorJanne Koschinski <janne@kuschku.de>
Wed, 20 Dec 2017 02:12:35 +0000 (03:12 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 21 Dec 2017 11:53:25 +0000 (12:53 +0100)
src/common/peer.h
src/common/protocol.h

index 64a333c..6f17ed6 100644 (file)
@@ -119,7 +119,7 @@ template<typename T> inline
 void Peer::handle(const T &protoMessage)
 {
     switch(protoMessage.handler()) {
-        case Protocol::SignalProxy:
+        case Protocol::Handler::SignalProxy:
             if (!signalProxy()) {
                 qWarning() << Q_FUNC_INFO << "Cannot handle message without a SignalProxy!";
                 return;
@@ -127,7 +127,7 @@ void Peer::handle(const T &protoMessage)
             signalProxy()->handle(this, protoMessage);
             break;
 
-        case Protocol::AuthHandler:
+        case Protocol::Handler::AuthHandler:
             if (!authHandler()) {
                 qWarning() << Q_FUNC_INFO << "Cannot handle auth messages without an active AuthHandler!";
                 return;
index f3c18e4..bf6c401 100644 (file)
@@ -42,7 +42,7 @@ enum Feature {
 };
 
 
-enum Handler {
+enum class Handler {
     SignalProxy,
     AuthHandler
 };
@@ -51,7 +51,7 @@ enum Handler {
 /*** Handshake, handled by AuthHandler ***/
 
 struct HandshakeMessage {
-    inline Handler handler() const { return AuthHandler; }
+    inline Handler handler() const { return Handler::AuthHandler; }
 };
 
 
@@ -179,7 +179,7 @@ struct SessionState : public HandshakeMessage
 
 struct SignalProxyMessage
 {
-    inline Handler handler() const { return SignalProxy; }
+    inline Handler handler() const { return Handler::SignalProxy; }
 };