diff options
Diffstat (limited to 'saltoqd/toqmanager.cpp')
-rw-r--r-- | saltoqd/toqmanager.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/saltoqd/toqmanager.cpp b/saltoqd/toqmanager.cpp index 104551e..ea59874 100644 --- a/saltoqd/toqmanager.cpp +++ b/saltoqd/toqmanager.cpp @@ -9,13 +9,14 @@ #include "musicmanager.h" #include "contactsmanager.h" #include "commmanager.h" +#include "agendamanager.h" #include "voicecallmanager.h" #include "weathermanager.h" #include "notificationmanager.h" static const bool PROTO_DEBUG = true; -ToqManager::ToqManager(MDConfGroup *settings, QObject *parent) : +ToqManager::ToqManager(Settings *settings, QObject *parent) : QObject(parent), _settings(settings), _conn(new ToqConnection(this)), @@ -27,6 +28,7 @@ ToqManager::ToqManager(MDConfGroup *settings, QObject *parent) : _musicManager(new MusicManager(this)), _contactsManager(new ContactsManager(_storageManager, this)), _commManager(new CommManager(_settings, _storageManager, _contactsManager, this)), + _agendaManager(new AgendaManager(_storageManager, this)), _voiceCallManager(new VoiceCallManager(_contactsManager, this)), _weatherManager(new WeatherManager(_fmsManager, this)), _cardManager(new CardManager(_fmsManager, this)), @@ -38,8 +40,10 @@ ToqManager::ToqManager(MDConfGroup *settings, QObject *parent) : this, &ToqManager::connected); connect(_conn, &ToqConnection::disconnected, this, &ToqManager::disconnected); + connect(_settings, &Settings::addressChanged, + this, &ToqManager::handleSettingsAddressChanged); - _conn->setAddress(QBluetoothAddress(_settings->value("address").toString())); + _conn->setAddress(QBluetoothAddress(_settings->address())); } void ToqManager::setEndpointListener(ToqConnection::Endpoint ep, EndpointHandler *handler) @@ -109,9 +113,7 @@ void ToqManager::handleToqMessage(const ToqConnection::Message &msg) } } -void ToqManager::handleSettingsChanged(const QString &key) +void ToqManager::handleSettingsAddressChanged() { - if (key == "address") { - _conn->setAddress(QBluetoothAddress(_settings->value("address").toString())); - } + _conn->setAddress(QBluetoothAddress(_settings->address())); } |