Don't create a QImage every time
This commit is contained in:
parent
716c598f4a
commit
95a26edad2
@ -65,10 +65,7 @@ NotificationsManager::postNotification(const mtx::responses::Notification ¬if
|
||||
QImage *
|
||||
NotificationsManager::getImgOrNullptr(const QString &path)
|
||||
{
|
||||
auto img = new QImage{path};
|
||||
if (img->isNull()) {
|
||||
delete img;
|
||||
if (QFile::exists(path))
|
||||
return nullptr;
|
||||
}
|
||||
return img;
|
||||
return new QImage{path};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user