Remove ImageItem, Paintable and use unified image provider.

This commit is contained in:
Black Hat
2018-12-03 19:55:42 +08:00
parent 641c82beb7
commit 8959be2cb8
29 changed files with 125 additions and 324 deletions

View File

@@ -153,7 +153,7 @@ QVariant RoomListModel::data(const QModelIndex& index, int role) const {
}
SpectralRoom* room = m_rooms.at(index.row());
if (role == NameRole) return room->displayName();
if (role == PaintableRole) return QVariant::fromValue(room->paintable());
if (role == AvatarRole) return room->avatarUrl();
if (role == TopicRole) return room->topic();
if (role == CategoryRole) {
if (room->joinState() == JoinState::Invite) return RoomType::Invited;
@@ -193,7 +193,7 @@ void RoomListModel::unreadMessagesChanged(SpectralRoom* room) {
QHash<int, QByteArray> RoomListModel::roleNames() const {
QHash<int, QByteArray> roles;
roles[NameRole] = "name";
roles[PaintableRole] = "paintable";
roles[AvatarRole] = "avatar";
roles[TopicRole] = "topic";
roles[CategoryRole] = "category";
roles[UnreadCountRole] = "unreadCount";