modernize: Use '= default' instead of empty ctor/dtor bodies
[quassel.git] / src / common / eventmanager.h
index 3701743..0a72a70 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2016 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  *
@@ -18,8 +18,9 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef EVENTMANAGER_H
-#define EVENTMANAGER_H
+#pragma once
+
+#include "common-export.h"
 
 #include <QMetaEnum>
 
@@ -28,7 +29,7 @@
 class Event;
 class Network;
 
-class EventManager : public QObject
+class COMMON_EXPORT EventManager : public QObject
 {
     Q_OBJECT
     Q_FLAGS(EventFlag EventFlags)
@@ -91,6 +92,7 @@ public :
         IrcEventAccount,
         IrcEventAway,
         IrcEventCap,
+        IrcEventChghost,
         IrcEventInvite,
         IrcEventJoin,
         IrcEventKick,
@@ -103,6 +105,7 @@ public :
         IrcEventPrivmsg,
         IrcEventQuit,
         IrcEventTopic,
+        IrcEventError,        /// ERROR message from server
         IrcEventWallops,
         IrcEventRawPrivmsg, ///< Undecoded privmsg (still needs CTCP parsing)
         IrcEventRawNotice, ///< Undecoded notice (still needs CTCP parsing)
@@ -119,7 +122,7 @@ public :
         KeyEvent                    = 0x00060000
     };
 
-    EventManager(QObject *parent = 0);
+    EventManager(QObject *parent = nullptr);
 
     static EventType eventTypeByName(const QString &name);
     static EventType eventGroupByName(const QString &name);
@@ -149,7 +152,7 @@ public slots:
 
 protected:
     virtual Network *networkById(NetworkId id) const = 0;
-    virtual void customEvent(QEvent *event);
+    void customEvent(QEvent *event) override;
 
 private:
     struct Handler {
@@ -157,7 +160,7 @@ private:
         int methodIndex;
         Priority priority;
 
-        explicit Handler(QObject *obj = 0, int method = 0, Priority prio = NormalPriority)
+        explicit Handler(QObject *obj = nullptr, int method = 0, Priority prio = NormalPriority)
         {
             object = obj;
             methodIndex = method;
@@ -165,7 +168,7 @@ private:
         }
     };
 
-    typedef QHash<uint, QList<Handler> > HandlerHash;
+    using HandlerHash = QHash<uint, QList<Handler>>;
 
     inline const HandlerHash &registeredHandlers() const { return _registeredHandlers; }
     inline HandlerHash &registeredHandlers() { return _registeredHandlers; }
@@ -193,6 +196,4 @@ private:
 };
 
 
-Q_DECLARE_OPERATORS_FOR_FLAGS(EventManager::EventFlags);
-
-#endif
+Q_DECLARE_OPERATORS_FOR_FLAGS(EventManager::EventFlags)