@@ -16,28 +16,24 @@
17#include "dashcommunicator.h"
17#include "dashcommunicator.h"
20#include <QDBusConnection>
19#include <QDBusConnection>
20+#include <QDBusConnectionInterface>
21#include <QDBusInterface>
21#include <QDBusInterface>
22#include <QDebug>
22#include <QDebug>
24−DashCommunicator::DashCommunicator(QObject *parent):
24+DashCommunicator::DashCommunicator(QObject *parent)
25+ : AbstractDBusServiceMonitor("com.canonical.UnityDash",
26+ "/com/canonical/UnityDash",
25− QObject(parent)
27+ "", parent)
29−DashCommunicator::~DashCommunicator()
34void DashCommunicator::setCurrentScope(const QString &scopeId, bool animate, bool reset)
31void DashCommunicator::setCurrentScope(const QString &scopeId, bool animate, bool reset)
36− QDBusConnection connection = QDBusConnection::sessionBus();
33+ if (dbusInterface() == nullptr) {
37− QDBusInterface dashIface ("com.canonical.UnityDash",
34+ qDebug() << "DashCommunicator - setCurrentScope failed as Dash DBus interface not available";
38− "/com/canonical/UnityDash",
35+ return;
42− dashIface.call("SetCurrentScope", scopeId, animate, reset);
37+ dbusInterface()->asyncCall("SetCurrentScope", scopeId, animate, reset);