summary refs log tree commit diff
path: root/src/notifications
diff options
context:
space:
mode:
authorDeepBlueV7.X <nicolas.werner@hotmail.de>2023-02-02 01:07:16 +0100
committerGitHub <noreply@github.com>2023-02-02 01:07:16 +0100
commit539db70fd5b5447941fa87da9d98504a5152106b (patch)
tree267c4905737f512e02ee78dbbeb824f2dc42981a /src/notifications
parentMerge pull request #1347 from mauke/url-regex-war-crime (diff)
parentchore: Adjust about function closeAllNotification (diff)
downloadnheko-539db70fd5b5447941fa87da9d98504a5152106b.tar.xz
Merge pull request #1341 from Decodetalkers/ft_clean_notify
clean all notifications if exit on linux
Diffstat (limited to 'src/notifications')
-rw-r--r--src/notifications/Manager.h3
-rw-r--r--src/notifications/ManagerLinux.cpp9
2 files changed, 12 insertions, 0 deletions
diff --git a/src/notifications/Manager.h b/src/notifications/Manager.h

index bf7af29b..70a03345 100644 --- a/src/notifications/Manager.h +++ b/src/notifications/Manager.h
@@ -55,6 +55,9 @@ public slots: #if defined(NHEKO_DBUS_SYS) public: void closeNotifications(QString roomId); +#if defined(Q_OS_LINUX) + void closeAllNotifications(); +#endif private: QDBusInterface dbus; diff --git a/src/notifications/ManagerLinux.cpp b/src/notifications/ManagerLinux.cpp
index 294df4db..c694d88f 100644 --- a/src/notifications/ManagerLinux.cpp +++ b/src/notifications/ManagerLinux.cpp
@@ -271,3 +271,12 @@ NotificationsManager::notificationClosed(uint id, uint reason) Q_UNUSED(reason); notificationIds.remove(id); } + +void +NotificationsManager::closeAllNotifications() +{ + for (auto id : notificationIds.keys()) { + closeNotification(id); + notificationIds.remove(id); + } +}