Use async call in closeNotification
This commit is contained in:
parent
ac36e92447
commit
1479743e70
@ -76,13 +76,11 @@ NotificationsManager::postNotification(const QString &roomid,
|
||||
"/org/freedesktop/Notifications",
|
||||
"org.freedesktop.Notifications");
|
||||
auto call = notifyApp.asyncCallWithArgumentList("Notify", argumentList);
|
||||
auto watcher = new QDBusPendingCall{QDBusPendingReply{call}};
|
||||
connect(watcher,
|
||||
&QDBusPendingCallWatcher::finished,
|
||||
this,
|
||||
[watcher, this, &roomid, &eventid]() {
|
||||
auto watcher = new QDBusPendingCallWatcher{QDBusPendingCall{QDBusPendingReply{call}}};
|
||||
connect(
|
||||
watcher, &QDBusPendingCallWatcher::finished, this, [watcher, this, &roomid, &eventid]() {
|
||||
if (watcher->reply().type() == QDBusMessage::ErrorMessage)
|
||||
qDebug() << "D-Bus Error:" << watcher.reply().errorMessage();
|
||||
qDebug() << "D-Bus Error:" << watcher->reply().errorMessage();
|
||||
else
|
||||
notificationIds[watcher->reply().arguments().first().toUInt()] =
|
||||
roomEventId{roomid, eventid};
|
||||
@ -99,11 +97,13 @@ NotificationsManager::closeNotification(uint id)
|
||||
static QDBusInterface closeCall("org.freedesktop.Notifications",
|
||||
"/org/freedesktop/Notifications",
|
||||
"org.freedesktop.Notifications");
|
||||
QDBusMessage reply =
|
||||
closeCall.callWithArgumentList(QDBus::AutoDetect, "CloseNotification", argumentList);
|
||||
if (reply.type() == QDBusMessage::ErrorMessage) {
|
||||
qDebug() << "D-Bus Error:" << reply.errorMessage();
|
||||
}
|
||||
auto call = closeCall.asyncCallWithArgumentList("CloseNotification", argumentList);
|
||||
auto watcher = new QDBusPendingCallWatcher{QDBusPendingCall{QDBusPendingReply{call}}};
|
||||
connect(watcher, &QDBusPendingCallWatcher::finished, this, [watcher, this]() {
|
||||
if (watcher->reply().type() == QDBusMessage::ErrorMessage) {
|
||||
qDebug() << "D-Bus Error:" << watcher->reply().errorMessage();
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user