mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 20:48:52 +03:00
Don't create a QImage every time
This commit is contained in:
parent
716c598f4a
commit
95a26edad2
1 changed files with 2 additions and 5 deletions
|
@ -65,10 +65,7 @@ NotificationsManager::postNotification(const mtx::responses::Notification ¬if
|
||||||
QImage *
|
QImage *
|
||||||
NotificationsManager::getImgOrNullptr(const QString &path)
|
NotificationsManager::getImgOrNullptr(const QString &path)
|
||||||
{
|
{
|
||||||
auto img = new QImage{path};
|
if (QFile::exists(path))
|
||||||
if (img->isNull()) {
|
|
||||||
delete img;
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
return new QImage{path};
|
||||||
return img;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue