summary refs log tree commit diff
path: root/src/notifications
diff options
context:
space:
mode:
authorLoren Burkholder <computersemiexpert@outlook.com>2021-03-02 19:51:44 -0500
committerNicolas Werner <nicolas.werner@hotmail.de>2021-03-17 19:18:07 +0100
commit95a26edad25fe7873076f06fcb902e90dcf83aac (patch)
treeb985dae2e22770d1a807fe4b9ed16d4c7928efd9 /src/notifications
parentSimplify macOS checks for a null image (diff)
downloadnheko-95a26edad25fe7873076f06fcb902e90dcf83aac.tar.xz
Don't create a QImage every time
Diffstat (limited to 'src/notifications')
-rw-r--r--src/notifications/ManagerMac.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/notifications/ManagerMac.cpp b/src/notifications/ManagerMac.cpp
index 0819272b..1bf1577f 100644
--- a/src/notifications/ManagerMac.cpp
+++ b/src/notifications/ManagerMac.cpp
@@ -65,10 +65,7 @@ NotificationsManager::postNotification(const mtx::responses::Notification &notif
 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};
 }