mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-29 14:18:49 +03:00
Fix broken avatars in quick switcher
This commit is contained in:
parent
c32a8bc226
commit
31a83c515e
1 changed files with 7 additions and 2 deletions
|
@ -113,6 +113,7 @@ RoomItem::RoomItem(QWidget *parent, const RoomSearchResult &res)
|
||||||
topLayout_->addWidget(avatar_);
|
topLayout_->addWidget(avatar_);
|
||||||
topLayout_->addWidget(roomName_, 1);
|
topLayout_->addWidget(roomName_, 1);
|
||||||
|
|
||||||
|
if (!res.info.avatar_url.empty())
|
||||||
avatar_->setImage(QString::fromStdString(res.info.avatar_url));
|
avatar_->setImage(QString::fromStdString(res.info.avatar_url));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,6 +129,10 @@ RoomItem::updateItem(const RoomSearchResult &result)
|
||||||
|
|
||||||
roomName_->setText(name);
|
roomName_->setText(name);
|
||||||
|
|
||||||
|
// if there is not an avatar set for the room, we want to at least show the letter
|
||||||
|
// correctly!
|
||||||
|
avatar_->setLetter(utils::firstChar(name));
|
||||||
|
if (!result.info.avatar_url.empty())
|
||||||
avatar_->setImage(QString::fromStdString(result.info.avatar_url));
|
avatar_->setImage(QString::fromStdString(result.info.avatar_url));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue