diff options
Diffstat (limited to 'daemon/manager.cpp')
| -rw-r--r-- | daemon/manager.cpp | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/daemon/manager.cpp b/daemon/manager.cpp index e6ebf26..179d05e 100644 --- a/daemon/manager.cpp +++ b/daemon/manager.cpp @@ -10,7 +10,6 @@ Manager::Manager(Settings *settings, QObject *parent) : QObject(parent), l(metaObject()->className()), settings(settings), proxy(new PebbledProxy(this)), watch(new WatchConnector(this)), - dbus(new DBusConnector(this)), upload(new UploadManager(watch, this)), apps(new AppManager(this)), bank(new BankManager(watch, upload, apps, this)), @@ -67,8 +66,8 @@ Manager::Manager(Settings *settings, QObject *parent) : session.registerObject("/org/pebbled/Watch", proxy); session.registerService("org.pebbled"); - connect(dbus, &DBusConnector::pebbleChanged, proxy, &PebbledProxy::NameChanged); - connect(dbus, &DBusConnector::pebbleChanged, proxy, &PebbledProxy::AddressChanged); + connect(watch, &WatchConnector::pebbleChanged, proxy, &PebbledProxy::NameChanged); + connect(watch, &WatchConnector::pebbleChanged, proxy, &PebbledProxy::AddressChanged); connect(watch, &WatchConnector::connectedChanged, proxy, &PebbledProxy::ConnectedChanged); connect(watch, &WatchConnector::versionsChanged, proxy, &PebbledProxy::InfoChanged); connect(bank, &BankManager::slotsChanged, proxy, &PebbledProxy::AppSlotsChanged); @@ -79,11 +78,7 @@ Manager::Manager(Settings *settings, QObject *parent) : // Set BT icon for notification notification.setImage("icon-system-bluetooth-device"); - if (btDevice.isValid()) { - qCDebug(l) << "BT local name:" << btDevice.name(); - connect(dbus, SIGNAL(pebbleChanged()), SLOT(onPebbleChanged())); - dbus->findPebble(); - } + watch->findPebbles(); } Manager::~Manager() @@ -100,17 +95,6 @@ void Manager::onSettingsChanged() qCWarning(l) << __FUNCTION__ << "Not implemented!"; } -void Manager::onPebbleChanged() -{ - const QVariantMap & pebble = dbus->pebble(); - QString name = pebble["Name"].toString(); - if (name.isEmpty()) { - qCDebug(l) << "Pebble gone"; - } else { - watch->deviceConnect(name, pebble["Address"].toString()); - } -} - void Manager::onConnectedChanged() { QString message = QString("%1 %2") @@ -130,8 +114,7 @@ void Manager::onActiveVoiceCallChanged() { qCDebug(l) << "Manager::onActiveVoiceCallChanged()"; - QVariant incomingCallNotification = settings->property("incomingCallNotification"); - if (incomingCallNotification.isValid() && !incomingCallNotification.toBool()) { + if (!settings->property("incomingCallNotification").toBool()) { qCDebug(l) << "Ignoring ActiveVoiceCallChanged because of setting!"; return; } |
