X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fmessagemodel.h;h=4ffeeb42da710b677d7a3a9f23eb384d71485093;hp=623efa667467f81c99c05332cd38516838af4714;hb=3ade6e11e29338aa74fa5daf32456264011601e1;hpb=91d4d49abb5e1a8dabba5ae5e460981afda0a354 diff --git a/src/client/messagemodel.h b/src/client/messagemodel.h index 623efa66..4ffeeb42 100644 --- a/src/client/messagemodel.h +++ b/src/client/messagemodel.h @@ -23,6 +23,7 @@ #include #include +#include #include "message.h" #include "types.h" @@ -56,7 +57,7 @@ public: MessageModel(QObject *parent); - inline QModelIndex index(int row, int column, const QModelIndex &/*parent*/ = QModelIndex()) const { return createIndex(row, column); } + inline QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; inline QModelIndex parent(const QModelIndex &) const { return QModelIndex(); } inline int rowCount(const QModelIndex &parent = QModelIndex()) const { return parent.isValid() ? 0 : messageCount(); } inline int columnCount(const QModelIndex &/*parent*/ = QModelIndex()) const { return 3; } @@ -71,6 +72,9 @@ public: void clear(); +signals: + void finishedBacklogFetch(BufferId bufferId); + public slots: void requestBacklog(BufferId bufferId); void messagesReceived(BufferId bufferId, int count); @@ -111,6 +115,14 @@ private: QHash _messagesWaiting; }; +// inlines +QModelIndex MessageModel::index(int row, int column, const QModelIndex &parent) const { + if(row < 0 || row >= rowCount(parent) || column < 0 || column >= columnCount(parent)) + return QModelIndex(); + + return createIndex(row, column); +} + // ************************************************** // MessageModelItem // **************************************************