adding new settings for proper message redirection
[quassel.git] / src / client / messagemodel.h
index 5b756df..0f25fa8 100644 (file)
@@ -55,7 +55,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 +68,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 +88,7 @@ private:
   QList<Message> _messageBuffer;
   QTimer _dayChangeTimer;
   QDateTime _nextDayChange;
+  QHash<BufferId, int> _messagesWaiting;
 };
 
 // **************************************************
@@ -122,4 +127,6 @@ private:
   Message::Flags _flags;
 };
 
+QDebug operator<<(QDebug dbg, const MessageModelItem &msgItem);
+
 #endif