Build the monolithic client (-DWANT_MONO=ON) by default again, as it's usable now
[quassel.git] / src / client / messagemodel.h
index 5b756df..c7c975d 100644 (file)
@@ -44,6 +44,7 @@ public:
     TimestampRole,
     FormatRole,
     ColumnTypeRole,
+    RedirectedToRole,
     UserRole
   };
 
@@ -55,7 +56,7 @@ public:
 
   inline QModelIndex index(int row, int column, const QModelIndex &/*parent*/ = QModelIndex()) const { return createIndex(row, column); }
   inline QModelIndex parent(const QModelIndex &) const { return QModelIndex(); }
-  inline int rowCount(const QModelIndex &/*parent*/ = QModelIndex()) const { return _messageList.count(); }
+  inline int rowCount(const QModelIndex &parent = QModelIndex()) const { return parent.isValid() ? 0 : _messageList.count(); }
   inline int columnCount(const QModelIndex &/*parent*/ = QModelIndex()) const { return 3; }
 
   virtual QVariant data(const QModelIndex &index, int role) const;
@@ -68,6 +69,10 @@ public:
 
   void clear();
 
+public slots:
+  void requestBacklog(BufferId bufferId);
+  void messagesReceived(BufferId bufferId, int count);
+
 protected:
   virtual MessageModelItem *createMessageModelItem(const Message &) = 0;
   virtual void customEvent(QEvent *event);
@@ -84,6 +89,7 @@ private:
   QList<Message> _messageBuffer;
   QTimer _dayChangeTimer;
   QDateTime _nextDayChange;
+  QHash<BufferId, int> _messagesWaiting;
 };
 
 // **************************************************
@@ -100,7 +106,7 @@ public:
   inline virtual ~MessageModelItem() {}
 
   virtual QVariant data(int column, int role) const;
-  virtual bool setData(int column, const QVariant &value, int role) = 0;
+  virtual bool setData(int column, const QVariant &value, int role);
 
   inline const QDateTime &timeStamp() const { return _timestamp; }
   inline MsgId msgId() const { return _msgId; }
@@ -118,8 +124,11 @@ private:
   QDateTime _timestamp;
   MsgId _msgId;
   BufferId _bufferId;
+  BufferId _redirectedTo;
   Message::Type _type;
   Message::Flags _flags;
 };
 
+QDebug operator<<(QDebug dbg, const MessageModelItem &msgItem);
+
 #endif