diff --git a/libukui-notification/notification-client.cpp b/libukui-notification/notification-client.cpp index 070b8ce..e32e01e 100644 --- a/libukui-notification/notification-client.cpp +++ b/libukui-notification/notification-client.cpp @@ -31,11 +31,7 @@ NotificationClientPrivate::NotificationClientPrivate(NotificationClient *q) : QO NotificationClientPrivate::~NotificationClientPrivate() { - if(m_notificationsInterface) { - m_notificationsInterface->call(QDBus::NoBlock, QStringLiteral("UnRegisterClient")); - delete m_notificationsInterface; - m_notificationsInterface = nullptr; - } + unregisterClient(); } bool NotificationClientPrivate::init() @@ -158,10 +154,10 @@ bool NotificationClientPrivate::closeNotification(uint id, NotificationCloseReas if(!m_serverInterface) { return false; } - QDBusMessage reply = m_serverInterface->callWithArgumentList(QDBus::NoBlock, QStringLiteral("CloseNotification"), {id, reason}); + QDBusMessage reply = m_serverInterface->callWithArgumentList(QDBus::BlockWithGui, QStringLiteral("CloseNotification"), {id, static_cast(reason)}); if (reply.type() == QDBusMessage::ErrorMessage) { qWarning() << "Failed to call CloseNotification!" << QDBusConnection::sessionBus().lastError(); - return false; + return false; } return true; } diff --git a/notification-server/server.cpp b/notification-server/server.cpp index 0e672bb..5528237 100644 --- a/notification-server/server.cpp +++ b/notification-server/server.cpp @@ -174,6 +174,7 @@ void ServerPrivate::CloseNotification(uint id, uint reason) if(m_notificationsCache.contains(id)) { m_notificationsCache.remove(id); } + qDebug() << "CloseNotification" << id << reason; Q_EMIT NotificationClosed(id, reason); }