@@ -15,32 +15,38 @@
17#include "dashcommunicator.h"
17#include "dashcommunicator.h"
18−
18+#include "dashconnection.h"
20#include <QObject>
20#include <QObject>
21−#include <QDBusConnection>
22−#include <QDBusConnectionInterface>
23−#include <QDBusInterface>
25−#include <QDBusPendingCall>
27DashCommunicator::DashCommunicator(QObject *parent):
22DashCommunicator::DashCommunicator(QObject *parent):
28 QThread(parent),
23 QThread(parent),
29− m_dashService(nullptr)
24+ m_dashConnection(nullptr),
34void DashCommunicator::setCurrentScope(const QString &scopeId, bool animate, bool isSwipe)
30void DashCommunicator::setCurrentScope(const QString &scopeId, bool animate, bool isSwipe)
36− m_dashService->dbusInterface()->asyncCall("SetCurrentScope", scopeId, animate, isSwipe);
32+ m_mutex.lock();
34+ QMetaObject::invokeMethod(m_dashConnection, "setCurrentScope",
35+ Q_ARG(QString, scopeId),
36+ Q_ARG(bool, animate),
37+ Q_ARG(bool, isSwipe));
39void DashCommunicator::run()
42void DashCommunicator::run()
41− m_dashService = new AbstractDBusServiceMonitor("com.canonical.UnityDash",
44+ m_dashConnection = new DashConnection("com.canonical.UnityDash",
42 "/com/canonical/UnityDash",
45 "/com/canonical/UnityDash",
43− "", AbstractDBusServiceMonitor::SessionBus, this);
46+ "", this);