| 68 | } |
| 69 | |
| 70 | QVariant RoomListModel::data(const QModelIndex& index, int role) const |
| 71 | { |
| 72 | if( !index.isValid() ) |
| 73 | return QVariant(); |
| 74 | |
| 75 | if( index.row() >= m_rooms.count() ) |
| 76 | { |
| 77 | qDebug() << "UserListModel: something wrong here..."; |
| 78 | return QVariant(); |
| 79 | } |
| 80 | QMatrixClient::Room* room = m_rooms.at(index.row()); |
| 81 | if( role == Qt::DisplayRole ) |
| 82 | { |
| 83 | return room->displayName(); |
| 84 | } |
| 85 | if( role == Qt::ForegroundRole ) |
| 86 | { |
| 87 | if( room->highlightCount() > 0 ) |
| 88 | return QBrush(QColor("orange")); |
| 89 | return QVariant(); |
| 90 | } |
| 91 | return QVariant(); |
| 92 | } |
| 93 | |
| 94 | void RoomListModel::namesChanged(QMatrixClient::Room* room) |
| 95 | { |
nothing calls this directly
no outgoing calls
no test coverage detected