X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fkeyevent.h;h=72fb0ec3665cc6a0da090e2043bbf2b754890ac6;hp=b3f4d48c899132c7489971a0d4b48ed1c1a9c332;hb=8dfdd498679c773cf2e7958c5fd434bf56f634e3;hpb=e8a39b4c3c92e193ab861a3fea84a261bb6fbd24 diff --git a/src/core/keyevent.h b/src/core/keyevent.h index b3f4d48c..72fb0ec3 100644 --- a/src/core/keyevent.h +++ b/src/core/keyevent.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2013-2018 by the Quassel Project * + * Copyright (C) 2013-2020 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -21,59 +21,62 @@ #ifndef KEYEVENT_H #define KEYEVENT_H +#include + #include "ircevent.h" class KeyEvent : public IrcEvent { public: - enum ExchangeType { + enum ExchangeType + { Init, Finish }; - explicit KeyEvent(EventManager::EventType type, Network *network, const QString &prefix, const QString &target, - ExchangeType exchangeType, const QByteArray &key, - const QDateTime ×tamp = QDateTime()) - : IrcEvent(type, network, prefix), - _exchangeType(exchangeType), - _target(target), - _key(key) + explicit KeyEvent(EventManager::EventType type, + Network* network, + QHash tags, + QString prefix, + QString target, + ExchangeType exchangeType, + QByteArray key, + const QDateTime& timestamp = QDateTime()) + : IrcEvent(type, network, std::move(tags), std::move(prefix)) + , _exchangeType(exchangeType) + , _target(std::move(target)) + , _key(std::move(key)) { setTimestamp(timestamp); } - inline ExchangeType exchangeType() const { return _exchangeType; } inline void setExchangeType(ExchangeType type) { _exchangeType = type; } inline QString target() const { return _target; } - inline void setTarget(const QString &target) { _target = target; } + inline void setTarget(const QString& target) { _target = target; } inline QByteArray key() const { return _key; } - inline void setKey(const QByteArray &key) { _key = key; } + inline void setKey(const QByteArray& key) { _key = key; } - static Event *create(EventManager::EventType type, QVariantMap &map, Network *network); + static Event* create(EventManager::EventType type, QVariantMap& map, Network* network); protected: - explicit KeyEvent(EventManager::EventType type, QVariantMap &map, Network *network); - void toVariantMap(QVariantMap &map) const override; + explicit KeyEvent(EventManager::EventType type, QVariantMap& map, Network* network); + void toVariantMap(QVariantMap& map) const override; inline QString className() const override { return "KeyEvent"; } - inline void debugInfo(QDebug &dbg) const override + inline void debugInfo(QDebug& dbg) const override { NetworkEvent::debugInfo(dbg); - dbg << ", prefix = " << qPrintable(prefix()) - << ", target = " << qPrintable(target()) - << ", exchangetype = " << (exchangeType() == Init ? "init" : "finish") - << ", key = " << key(); + dbg << ", prefix = " << qPrintable(prefix()) << ", target = " << qPrintable(target()) + << ", exchangetype = " << (exchangeType() == Init ? "init" : "finish") << ", key = " << key(); } - private: ExchangeType _exchangeType; QString _target; QByteArray _key; }; - #endif