X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fircevent.h;h=5d13b2f57fc72065a0c32d69a44b3af57ad936a5;hp=b95013652daa4d8c6568d0f805e70cab37599348;hb=ed5b2ff32158ae72c011eb1228f373cec05cbfeb;hpb=5b686746c880e5cda6d5de3e08180ea4332ff222 diff --git a/src/common/ircevent.h b/src/common/ircevent.h index b9501365..5d13b2f5 100644 --- a/src/common/ircevent.h +++ b/src/common/ircevent.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2012 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,19 +18,22 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef IRCEVENT_H -#define IRCEVENT_H +#pragma once + +#include + +#include "common-export.h" #include "networkevent.h" #include "util.h" -class IrcEvent : public NetworkEvent +class COMMON_EXPORT IrcEvent : public NetworkEvent { public: - explicit IrcEvent(EventManager::EventType type, Network *network, const QString &prefix, const QStringList ¶ms = QStringList()) + explicit IrcEvent(EventManager::EventType type, Network *network, QString prefix, QStringList params = QStringList()) : NetworkEvent(type, network), - _prefix(prefix), - _params(params) + _prefix(std::move(prefix)), + _params(std::move(params)) {} inline QString prefix() const { return _prefix; } @@ -45,10 +48,10 @@ public: protected: explicit IrcEvent(EventManager::EventType type, QVariantMap &map, Network *network); - void toVariantMap(QVariantMap &map) const; + void toVariantMap(QVariantMap &map) const override; - virtual inline QString className() const { return "IrcEvent"; } - virtual inline void debugInfo(QDebug &dbg) const + inline QString className() const override { return "IrcEvent"; } + inline void debugInfo(QDebug &dbg) const override { NetworkEvent::debugInfo(dbg); dbg << ", prefix = " << qPrintable(prefix()) @@ -62,13 +65,13 @@ private: }; -class IrcEventNumeric : public IrcEvent +class COMMON_EXPORT IrcEventNumeric : public IrcEvent { public: - explicit IrcEventNumeric(uint number, Network *network, const QString &prefix, const QString &target, const QStringList ¶ms = QStringList()) + explicit IrcEventNumeric(uint number, Network *network, const QString &prefix, QString target, const QStringList ¶ms = QStringList()) : IrcEvent(EventManager::IrcEventNumeric, network, prefix, params), _number(number), - _target(target) + _target(std::move(target)) {} inline uint number() const { return _number; } @@ -78,10 +81,10 @@ public: protected: explicit IrcEventNumeric(EventManager::EventType type, QVariantMap &map, Network *network); - void toVariantMap(QVariantMap &map) const; + void toVariantMap(QVariantMap &map) const override; - virtual inline QString className() const { return "IrcEventNumeric"; } - virtual inline void debugInfo(QDebug &dbg) const + inline QString className() const override { return "IrcEventNumeric"; } + inline void debugInfo(QDebug &dbg) const override { dbg << ", num = " << number(); NetworkEvent::debugInfo(dbg); @@ -99,14 +102,14 @@ private: }; -class IrcEventRawMessage : public IrcEvent +class COMMON_EXPORT IrcEventRawMessage : public IrcEvent { public: explicit inline IrcEventRawMessage(EventManager::EventType type, Network *network, - const QByteArray &rawMessage, const QString &prefix, const QString &target, + QByteArray rawMessage, const QString &prefix, const QString &target, const QDateTime ×tamp = QDateTime()) : IrcEvent(type, network, prefix, QStringList() << target), - _rawMessage(rawMessage) + _rawMessage(std::move(rawMessage)) { setTimestamp(timestamp); } @@ -120,10 +123,10 @@ public: protected: explicit IrcEventRawMessage(EventManager::EventType type, QVariantMap &map, Network *network); - void toVariantMap(QVariantMap &map) const; + void toVariantMap(QVariantMap &map) const override; - virtual inline QString className() const { return "IrcEventRawMessage"; } - virtual inline void debugInfo(QDebug &dbg) const + inline QString className() const override { return "IrcEventRawMessage"; } + inline void debugInfo(QDebug &dbg) const override { NetworkEvent::debugInfo(dbg); dbg << ", target = " << qPrintable(target()) @@ -137,6 +140,3 @@ private: friend class IrcEvent; }; - - -#endif