Fix missing sessionBus() in core/notificationserverinfo.cpp

This commit is contained in:
Weixuan Xiao 2019-06-09 18:45:03 +00:00
parent 5431073844
commit 13230ff580

View file

@ -23,7 +23,8 @@
#include <QDBusMessage> #include <QDBusMessage>
#include <QDBusPendingReply> #include <QDBusPendingReply>
#include <QDBusPendingCallWatcher> #include <QDBusPendingCallWatcher>
#include <QDBusConnection>
#include "dbushelper.h"
#include "core_debug.h" #include "core_debug.h"
@ -37,7 +38,7 @@ void NotificationServerInfo::init()
{ {
QDBusMessage query = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.Notifications"), QStringLiteral("/org/freedesktop/Notifications"), QStringLiteral("org.freedesktop.Notifications"), QStringLiteral("GetCapabilities")); QDBusMessage query = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.Notifications"), QStringLiteral("/org/freedesktop/Notifications"), QStringLiteral("org.freedesktop.Notifications"), QStringLiteral("GetCapabilities"));
QDBusPendingReply<QStringList> reply = QDBusConnection::sessionBus().asyncCall(query); QDBusPendingReply<QStringList> reply = DbusHelper::sessionBus().asyncCall(query);
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this);
connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, reply, watcher] { connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, reply, watcher] {
watcher->deleteLater(); watcher->deleteLater();