handled a case when user removes downloaded file, minor optimizations on message changing

This commit is contained in:
Blue 2021-04-28 23:26:19 +03:00
parent b44873d587
commit 50190f3eac
23 changed files with 136 additions and 40 deletions

View file

@ -310,7 +310,11 @@ void MessageDelegate::paintPreview(const Models::FeedItem& data, QPainter* paint
start = option.rect.topLeft();
}
QImage img(data.attach.localPath);
painter->drawImage(QRect(start, size), img);
if (img.isNull()) {
emit invalidPath(data.id);
} else {
painter->drawImage(QRect(start, size), img);
}
option.rect.adjust(0, size.height() + textMargin, 0, 0);
}