fix(libukui-notification):修复通知通知时无关闭信号的问题
This commit is contained in:
parent
8233bfaa07
commit
eed5f84cf4
|
@ -31,11 +31,7 @@ NotificationClientPrivate::NotificationClientPrivate(NotificationClient *q) : QO
|
||||||
|
|
||||||
NotificationClientPrivate::~NotificationClientPrivate()
|
NotificationClientPrivate::~NotificationClientPrivate()
|
||||||
{
|
{
|
||||||
if(m_notificationsInterface) {
|
unregisterClient();
|
||||||
m_notificationsInterface->call(QDBus::NoBlock, QStringLiteral("UnRegisterClient"));
|
|
||||||
delete m_notificationsInterface;
|
|
||||||
m_notificationsInterface = nullptr;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NotificationClientPrivate::init()
|
bool NotificationClientPrivate::init()
|
||||||
|
@ -158,10 +154,10 @@ bool NotificationClientPrivate::closeNotification(uint id, NotificationCloseReas
|
||||||
if(!m_serverInterface) {
|
if(!m_serverInterface) {
|
||||||
return false;
|
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) {
|
if (reply.type() == QDBusMessage::ErrorMessage) {
|
||||||
qWarning() << "Failed to call CloseNotification!" << QDBusConnection::sessionBus().lastError();
|
qWarning() << "Failed to call CloseNotification!" << QDBusConnection::sessionBus().lastError();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,6 +174,7 @@ void ServerPrivate::CloseNotification(uint id, uint reason)
|
||||||
if(m_notificationsCache.contains(id)) {
|
if(m_notificationsCache.contains(id)) {
|
||||||
m_notificationsCache.remove(id);
|
m_notificationsCache.remove(id);
|
||||||
}
|
}
|
||||||
|
qDebug() << "CloseNotification" << id << reason;
|
||||||
Q_EMIT NotificationClosed(id, reason);
|
Q_EMIT NotificationClosed(id, reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue