Message object cleanup
authorMarcus Eggenberger <egs@quassel-irc.org>
Tue, 13 Jan 2009 12:57:44 +0000 (13:57 +0100)
committerMarcus Eggenberger <egs@quassel-irc.org>
Tue, 13 Jan 2009 15:35:08 +0000 (16:35 +0100)
src/common/message.cpp
src/common/message.h

index f1f7c48..c867a7c 100644 (file)
@@ -44,10 +44,6 @@ Message::Message(const QDateTime &ts, const BufferInfo &bufferInfo, Type type, c
 {
 }
 
 {
 }
 
-void Message::setFlags(Flags flags) {
-  _flags = flags;
-}
-
 QDataStream &operator<<(QDataStream &out, const Message &msg) {
   out << msg.msgId() << (quint32)msg.timestamp().toTime_t() << (quint32)msg.type() << (quint8)msg.flags()
       << msg.bufferInfo() << msg.sender().toUtf8() << msg.contents().toUtf8();
 QDataStream &operator<<(QDataStream &out, const Message &msg) {
   out << msg.msgId() << (quint32)msg.timestamp().toTime_t() << (quint32)msg.type() << (quint8)msg.flags()
       << msg.bufferInfo() << msg.sender().toUtf8() << msg.contents().toUtf8();
index d042c7b..c1b8e62 100644 (file)
@@ -74,9 +74,10 @@ public:
   inline QString sender() const { return _sender; }
   inline Type type() const { return _type; }
   inline Flags flags() const { return _flags; }
   inline QString sender() const { return _sender; }
   inline Type type() const { return _type; }
   inline Flags flags() const { return _flags; }
+  inline void setFlags(Flags flags) { _flags = flags; }
   inline QDateTime timestamp() const { return _timestamp; }
 
   inline QDateTime timestamp() const { return _timestamp; }
 
-  void setFlags(Flags flags);
+  inline bool isValid() const { return _msgId.isValid(); }
 
   inline bool operator<(const Message &other) const { return _msgId < other._msgId; }
 
 
   inline bool operator<(const Message &other) const { return _msgId < other._msgId; }
 
@@ -89,8 +90,6 @@ private:
   Type _type;
   Flags _flags;
 
   Type _type;
   Flags _flags;
 
-  QString _formattedTimestamp, _formattedSender, _formattedText; // cache
-
   friend QDataStream &operator>>(QDataStream &in, Message &msg);
 };
 
   friend QDataStream &operator>>(QDataStream &in, Message &msg);
 };