X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fkeyevent.h;h=1985a9480afccd7e043d9338111ebf3a352c76ea;hp=65db084a9bc6a6a6a318c4711b07b9b379b19790;hb=c1cf157116de7fc3da96203aa6f03c38c7ebb650;hpb=30b159cb876a9495de42e9a3e70ca050516f0805 diff --git a/src/core/keyevent.h b/src/core/keyevent.h index 65db084a..1985a948 100644 --- a/src/core/keyevent.h +++ b/src/core/keyevent.h @@ -28,54 +28,54 @@ class KeyEvent : public IrcEvent { public: - enum ExchangeType { + enum ExchangeType + { Init, Finish }; - explicit KeyEvent(EventManager::EventType type, Network *network, const QString &prefix, QString target, - ExchangeType exchangeType, QByteArray key, - const QDateTime ×tamp = QDateTime()) - : IrcEvent(type, network, prefix), - _exchangeType(exchangeType), - _target(std::move(target)), - _key(std::move(key)) + explicit KeyEvent(EventManager::EventType type, + Network* network, + const QString& prefix, + QString target, + ExchangeType exchangeType, + QByteArray key, + const QDateTime& timestamp = QDateTime()) + : IrcEvent(type, network, 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