fix(libukui-notification):修复通知通知时无关闭信号的问题
This commit is contained in:
parent
a8edfe1d51
commit
4497d5be6c
|
@ -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,7 +154,7 @@ 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<uint32_t>(reason)});
|
||||
if (reply.type() == QDBusMessage::ErrorMessage) {
|
||||
qWarning() << "Failed to call CloseNotification!" << QDBusConnection::sessionBus().lastError();
|
||||
return false;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue