Add avatar support.

This commit is contained in:
Black Hat
2018-03-02 16:56:36 +08:00
parent 6a610e3808
commit d4c2a1ed50
10 changed files with 148 additions and 52 deletions

View File

@@ -53,8 +53,8 @@ QVariant RoomListModel::data(const QModelIndex& index, int role) const {
if(role == ValueRole) {
return room->topic();
}
if(role == IconRole) {
return room->avatar(48);
if(role == AvatarRole) {
return room->avatarUrl();
}
return QVariant();
}
@@ -63,7 +63,7 @@ QHash<int, QByteArray> RoomListModel::roleNames() const {
QHash<int, QByteArray> roles;
roles[NameRole] = "name";
roles[ValueRole] = "value";
roles[IconRole] = "icon";
roles[AvatarRole] = "avatar";
return roles;
}
@@ -75,8 +75,3 @@ void RoomListModel::namesChanged(QMatrixClient::Room* room) {
void RoomListModel::unreadMessagesChanged(QMatrixClient::Room* room) {
}
RoomModel::RoomModel(QString name, QString value) {
m_name = name;
m_value = value;
}