[Effects] QDBusAbstractInterface needs valid object path

I noticed that the GetActive call fails with an "Object path cannot be empty" error
when stealing that code for PowerDevil.

Differential Revision: https://phabricator.kde.org/D1910
This commit is contained in:
Kai Uwe Broulik 2016-06-16 11:26:16 +02:00
parent 4560f8d253
commit 2c47bdab3c

View file

@ -104,7 +104,7 @@ void ScreenLockerWatcher::serviceOwnerChanged(const QString &serviceName, const
m_interface = NULL;
m_locked = false;
if (!newOwner.isEmpty()) {
m_interface = new OrgFreedesktopScreenSaverInterface(newOwner, QString(), QDBusConnection::sessionBus(), this);
m_interface = new OrgFreedesktopScreenSaverInterface(newOwner, QStringLiteral("/ScreenSaver"), QDBusConnection::sessionBus(), this);
connect(m_interface, SIGNAL(ActiveChanged(bool)), SLOT(setLocked(bool)));
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(m_interface->GetActive(), this);
connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), SLOT(activeQueried(QDBusPendingCallWatcher*)));