From a685245313299e70e66efa4fc05d9e5dda073ea6 Mon Sep 17 00:00:00 2001 From: iaom Date: Mon, 20 Nov 2023 14:54:05 +0800 Subject: [PATCH] =?UTF-8?q?fix(notification-server):=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E5=85=B3=E9=97=AD=E9=80=9A=E7=9F=A5=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=A4=B1=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- notification-server/server.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/notification-server/server.cpp b/notification-server/server.cpp index 5528237..43d3dc6 100644 --- a/notification-server/server.cpp +++ b/notification-server/server.cpp @@ -112,14 +112,11 @@ QString ServerPrivate::GetServerInformation(QString &vendor, QString &version, Q void ServerPrivate::CloseNotification(uint id) { - for(const QString &service : m_notificationWatchers->watchedServices()) { - QDBusMessage msg = QDBusMessage::createMethodCall(service, - QStringLiteral("/NotificationClient"), - QStringLiteral("org.ukui.NotificationClient"), - QStringLiteral("CloseNotification")); - msg.setArguments({id, UkuiNotification::NotificationCloseReason::Revoked}); - QDBusConnection::sessionBus().call(msg, QDBus::NoBlock); + if(m_notificationsCache.contains(id)) { + m_notificationsCache.remove(id); } + qDebug() << "CloseNotification(Revoked)" << id; + Q_EMIT NotificationClosed(id, UkuiNotification::NotificationCloseReason::Revoked); } bool ServerPrivate::init()