MCPcopy Create free account
hub / github.com/davidar/tensor / data

Method data

client/models/roomlistmodel.cpp:70–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70QVariant 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
94void RoomListModel::namesChanged(QMatrixClient::Room* room)
95{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected