X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fnetworkevent.h;h=39d48686ac41d49d6b9a59b2012352893d2f3377;hp=fcae0b4592652b44a3aeb9c8625fc1f03634ec78;hb=3a3e844f9fcfd12235a0086af75ecd503b621ef4;hpb=92fc8c5b119111a35ab8423c3cbde5b2a022badf diff --git a/src/common/networkevent.h b/src/common/networkevent.h index fcae0b45..39d48686 100644 --- a/src/common/networkevent.h +++ b/src/common/networkevent.h @@ -22,6 +22,7 @@ #include #include +#include #include "event.h" #include "network.h" @@ -41,10 +42,10 @@ public: protected: explicit NetworkEvent(EventManager::EventType type, QVariantMap &map, Network *network); - void toVariantMap(QVariantMap &map) const; + void toVariantMap(QVariantMap &map) const override; - virtual inline QString className() const { return "NetworkEvent"; } - virtual inline void debugInfo(QDebug &dbg) const { dbg.nospace() << ", net = " << qPrintable(_network->networkName()); } + inline QString className() const override { return "NetworkEvent"; } + inline void debugInfo(QDebug &dbg) const override { dbg.nospace() << ", net = " << qPrintable(_network->networkName()); } private: Network *_network; @@ -66,10 +67,10 @@ public: protected: explicit NetworkConnectionEvent(EventManager::EventType type, QVariantMap &map, Network *network); - void toVariantMap(QVariantMap &map) const; + void toVariantMap(QVariantMap &map) const override; - virtual inline QString className() const { return "NetworkConnectionEvent"; } - virtual inline void debugInfo(QDebug &dbg) const + inline QString className() const override { return "NetworkConnectionEvent"; } + inline void debugInfo(QDebug &dbg) const override { NetworkEvent::debugInfo(dbg); dbg.nospace() << ", state = " << qPrintable(QString::number(_state)); @@ -86,9 +87,9 @@ private: class COMMON_EXPORT NetworkDataEvent : public NetworkEvent { public: - explicit NetworkDataEvent(EventManager::EventType type, Network *network, const QByteArray &data) + explicit NetworkDataEvent(EventManager::EventType type, Network *network, QByteArray data) : NetworkEvent(type, network), - _data(data) + _data(std::move(data)) {} inline QByteArray data() const { return _data; } @@ -96,10 +97,10 @@ public: protected: explicit NetworkDataEvent(EventManager::EventType type, QVariantMap &map, Network *network); - void toVariantMap(QVariantMap &map) const; + void toVariantMap(QVariantMap &map) const override; - virtual inline QString className() const { return "NetworkDataEvent"; } - virtual inline void debugInfo(QDebug &dbg) const + inline QString className() const override { return "NetworkDataEvent"; } + inline void debugInfo(QDebug &dbg) const override { NetworkEvent::debugInfo(dbg); dbg.nospace() << ", data = " << data(); @@ -118,13 +119,13 @@ class COMMON_EXPORT NetworkSplitEvent : public NetworkEvent public: explicit NetworkSplitEvent(EventManager::EventType type, Network *network, - const QString &channel, - const QStringList &users, - const QString &quitMsg) + QString channel, + QStringList users, + QString quitMsg) : NetworkEvent(type, network), - _channel(channel), - _users(users), - _quitMsg(quitMsg) + _channel(std::move(channel)), + _users(std::move(users)), + _quitMsg(std::move(quitMsg)) {} inline QString channel() const { return _channel; } @@ -133,10 +134,10 @@ public: protected: explicit NetworkSplitEvent(EventManager::EventType type, QVariantMap &map, Network *network); - void toVariantMap(QVariantMap &map) const; + void toVariantMap(QVariantMap &map) const override; - virtual inline QString className() const { return "NetworkSplitEvent"; } - virtual inline void debugInfo(QDebug &dbg) const + inline QString className() const override { return "NetworkSplitEvent"; } + inline void debugInfo(QDebug &dbg) const override { NetworkEvent::debugInfo(dbg); dbg.nospace() << ", channel = " << qPrintable(channel())