Fix crash in ImagePacksModel
This commit is contained in:
@@ -64,11 +64,13 @@ void ImagePacksModel::setRoom(NeoChatRoom *room)
|
|||||||
}
|
}
|
||||||
m_room = room;
|
m_room = room;
|
||||||
|
|
||||||
connect(m_room->connection(), &Connection::accountDataChanged, this, [this](const QString &type) {
|
if (m_room) {
|
||||||
if (type == "im.ponies.user_emotes"_ls) {
|
connect(m_room->connection(), &Connection::accountDataChanged, this, [this](const QString &type) {
|
||||||
reloadImages();
|
if (type == "im.ponies.user_emotes"_ls) {
|
||||||
}
|
reloadImages();
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
// TODO listen to packs changing
|
// TODO listen to packs changing
|
||||||
reloadImages();
|
reloadImages();
|
||||||
Q_EMIT roomChanged();
|
Q_EMIT roomChanged();
|
||||||
@@ -76,6 +78,9 @@ void ImagePacksModel::setRoom(NeoChatRoom *room)
|
|||||||
|
|
||||||
void ImagePacksModel::reloadImages()
|
void ImagePacksModel::reloadImages()
|
||||||
{
|
{
|
||||||
|
if (!m_room) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
m_events.clear();
|
m_events.clear();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user