summary refs log tree commit diff
path: root/src/notifications/ManagerLinux.cpp
diff options
context:
space:
mode:
authorLoren Burkholder <computersemiexpert@outlook.com>2021-01-20 16:04:02 -0500
committerLoren Burkholder <computersemiexpert@outlook.com>2021-01-20 16:08:56 -0500
commitac36e924472582edbf99eeff879c638c708c5a41 (patch)
tree1739dedb8a5a672d55de18196d3bea6c7c6b045d /src/notifications/ManagerLinux.cpp
parentmake lint (diff)
downloadnheko-ac36e924472582edbf99eeff879c638c708c5a41.tar.xz
Make watcher a pointer so that it doesn't get destroyed too soon
Diffstat (limited to 'src/notifications/ManagerLinux.cpp')
-rw-r--r--src/notifications/ManagerLinux.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/notifications/ManagerLinux.cpp b/src/notifications/ManagerLinux.cpp

index b86c5223..ad9e2c21 100644 --- a/src/notifications/ManagerLinux.cpp +++ b/src/notifications/ManagerLinux.cpp
@@ -76,16 +76,17 @@ NotificationsManager::postNotification(const QString &roomid, "/org/freedesktop/Notifications", "org.freedesktop.Notifications"); auto call = notifyApp.asyncCallWithArgumentList("Notify", argumentList); - QDBusPendingCallWatcher watcher{QDBusPendingReply{call}}; - connect(&watcher, + auto watcher = new QDBusPendingCall{QDBusPendingReply{call}}; + connect(watcher, &QDBusPendingCallWatcher::finished, this, - [&watcher, this, &roomid, &eventid]() { - if (watcher.reply().type() == QDBusMessage::ErrorMessage) + [watcher, this, &roomid, &eventid]() { + if (watcher->reply().type() == QDBusMessage::ErrorMessage) qDebug() << "D-Bus Error:" << watcher.reply().errorMessage(); else - notificationIds[watcher.reply().arguments().first().toUInt()] = + notificationIds[watcher->reply().arguments().first().toUInt()] = roomEventId{roomid, eventid}; + delete watcher; }); }