X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fmessageevent.h;h=8faf1fda462f90f9b37a59909aa9822034e8b184;hp=b18225b7687cf6cb3a6596c201c63beccb431bd2;hb=c1cf157116de7fc3da96203aa6f03c38c7ebb650;hpb=76db8cdfbeffaaba359c8e80cf2146da9e9e7f8a diff --git a/src/common/messageevent.h b/src/common/messageevent.h index b18225b7..8faf1fda 100644 --- a/src/common/messageevent.h +++ b/src/common/messageevent.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2013 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 MESSAGEEVENT_H -#define MESSAGEEVENT_H +#pragma once + +#include "common-export.h" #include "message.h" #include "networkevent.h" @@ -27,17 +28,16 @@ // this corresponds to CoreSession::RawMessage for now and should contain the information we need to convert events // into messages for the legacy code to work with -class MessageEvent : public NetworkEvent +class COMMON_EXPORT MessageEvent : public NetworkEvent { public: explicit MessageEvent(Message::Type msgType, - Network *network, - const QString &msg, - const QString &sender = QString(), - const QString &target = QString(), - Message::Flags msgFlags = Message::None, - const QDateTime ×tamp = QDateTime() - ); + Network* network, + QString msg, + const QString& sender = QString(), + QString target = QString(), + Message::Flags msgFlags = Message::None, + const QDateTime& timestamp = QDateTime()); inline Message::Type msgType() const { return _msgType; } inline void setMsgType(Message::Type type) { _msgType = type; } @@ -53,33 +53,27 @@ public: inline void setMsgFlag(Message::Flag flag) { _msgFlags |= flag; } inline void setMsgFlags(Message::Flags flags) { _msgFlags = flags; } - static Event *create(EventManager::EventType type, QVariantMap &map, Network *network); + static Event* create(EventManager::EventType type, QVariantMap& map, Network* network); protected: - explicit MessageEvent(EventManager::EventType type, QVariantMap &map, Network *network); - void toVariantMap(QVariantMap &map) const; + explicit MessageEvent(EventManager::EventType type, QVariantMap& map, Network* network); + void toVariantMap(QVariantMap& map) const override; - virtual inline QString className() const { return "MessageEvent"; } - virtual inline void debugInfo(QDebug &dbg) const + inline QString className() const override { return "MessageEvent"; } + inline void debugInfo(QDebug& dbg) const override { NetworkEvent::debugInfo(dbg); - dbg.nospace() << ", sender = " << qPrintable(sender()) - << ", target = " << qPrintable(target()) - << ", text = " << text() + dbg.nospace() << ", sender = " << qPrintable(sender()) << ", target = " << qPrintable(target()) << ", text = " << text() << ", msgtype = " << qPrintable(QString::number(msgType(), 16)) << ", buffertype = " << qPrintable(QString::number(bufferType(), 16)) << ", msgflags = " << qPrintable(QString::number(msgFlags(), 16)); } - private: - BufferInfo::Type bufferTypeByTarget(const QString &target) const; + BufferInfo::Type bufferTypeByTarget(const QString& target) const; Message::Type _msgType; BufferInfo::Type _bufferType; QString _text, _sender, _target; Message::Flags _msgFlags; }; - - -#endif