From acd137e98a5bb4bbca2fa66b84cd680ab20dafcf Mon Sep 17 00:00:00 2001 From: Tomasz Sterna Date: Wed, 13 Aug 2014 22:03:34 +0200 Subject: Fixed handling of connected signal in Manager app --- daemon/daemon.cpp | 1 + daemon/manager.cpp | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'daemon') diff --git a/daemon/daemon.cpp b/daemon/daemon.cpp index 584710a..9d89980 100644 --- a/daemon/daemon.cpp +++ b/daemon/daemon.cpp @@ -87,6 +87,7 @@ int main(int argc, char *argv[]) signal(SIGINT, signalhandler); signal(SIGTERM, signalhandler); QObject::connect(&app, SIGNAL(aboutToQuit()), &watch, SLOT(endPhoneCall())); + QObject::connect(&app, SIGNAL(aboutToQuit()), &watch, SLOT(disconnect())); return app.exec(); } diff --git a/daemon/manager.cpp b/daemon/manager.cpp index fd31e3d..b01006c 100644 --- a/daemon/manager.cpp +++ b/daemon/manager.cpp @@ -35,15 +35,6 @@ Manager::Manager(watch::WatchConnector *watch, DBusConnector *dbus, VoiceCallMan connect(watch, SIGNAL(messageDecoded(uint,QByteArray)), commands, SLOT(processMessage(uint,QByteArray))); connect(commands, SIGNAL(hangup()), SLOT(hangupAll())); - // Set BT icon for notification - notification.setImage("icon-system-bluetooth-device"); - - if (btDevice.isValid()) { - logger()->debug() << "BT local name:" << btDevice.name(); - connect(dbus, SIGNAL(pebbleChanged()), SLOT(onPebbleChanged())); - dbus->findPebble(); - } - PebbledProxy *proxy = new PebbledProxy(this); PebbledAdaptor *adaptor = new PebbledAdaptor(proxy); QDBusConnection session = QDBusConnection::sessionBus(); @@ -62,6 +53,16 @@ Manager::Manager(watch::WatchConnector *watch, DBusConnector *dbus, VoiceCallMan this, SLOT(onMprisPropertiesChanged(QString,QMap,QStringList))); connect(this, SIGNAL(mprisMetadataChanged(QVariantMap)), commands, SLOT(onMprisMetadataChanged(QVariantMap))); + + // Set BT icon for notification + notification.setImage("icon-system-bluetooth-device"); + + if (btDevice.isValid()) { + logger()->debug() << "BT local name:" << btDevice.name(); + connect(dbus, SIGNAL(pebbleChanged()), SLOT(onPebbleChanged())); + dbus->findPebble(); + } + } void Manager::onSettingChanged(const QString &key) -- cgit v1.2.3