| 28 | } |
| 29 | |
| 30 | class RoomListModel: public QAbstractListModel |
| 31 | { |
| 32 | Q_OBJECT |
| 33 | public: |
| 34 | RoomListModel(QObject* parent=0); |
| 35 | virtual ~RoomListModel(); |
| 36 | |
| 37 | Q_INVOKABLE void setConnection(QMatrixClient::Connection* connection); |
| 38 | Q_INVOKABLE QMatrixClient::Room* roomAt(int row); |
| 39 | |
| 40 | QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; |
| 41 | int rowCount(const QModelIndex& parent=QModelIndex()) const override; |
| 42 | |
| 43 | private slots: |
| 44 | void namesChanged(QMatrixClient::Room* room); |
| 45 | void unreadMessagesChanged(QMatrixClient::Room* room); |
| 46 | void addRoom(QMatrixClient::Room* room); |
| 47 | |
| 48 | private: |
| 49 | QMatrixClient::Connection* m_connection; |
| 50 | QList<QMatrixClient::Room*> m_rooms; |
| 51 | }; |
| 52 | |
| 53 | #endif // ROOMLISTMODEL_H |
nothing calls this directly
no outgoing calls
no test coverage detected