summary refs log tree commit diff
path: root/src/notifications/ManagerMac.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/notifications/ManagerMac.cpp')
-rw-r--r--src/notifications/ManagerMac.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/notifications/ManagerMac.cpp b/src/notifications/ManagerMac.cpp

index 1bf1577f..de5d0875 100644 --- a/src/notifications/ManagerMac.cpp +++ b/src/notifications/ManagerMac.cpp
@@ -39,9 +39,9 @@ NotificationsManager::postNotification(const mtx::responses::Notification &notif cache::displayName(QString::fromStdString(notification.room_id), QString::fromStdString(mtx::accessors::sender(notification.event))); - QImage *image = nullptr; + QImage image; if (mtx::accessors::msg_type(notification.event) == mtx::events::MessageType::Image) - image = getImgOrNullptr(cacheImage(notification.event)); + image = QImage{cacheImage(notification.event)}; const auto isEncrypted = std::get_if<mtx::events::EncryptedEvent<mtx::events::msg::Encrypted>>( @@ -61,11 +61,3 @@ NotificationsManager::postNotification(const mtx::responses::Notification &notif room_name, messageInfo, formatNotification(notification), image); } } - -QImage * -NotificationsManager::getImgOrNullptr(const QString &path) -{ - if (QFile::exists(path)) - return nullptr; - return new QImage{path}; -}