diff options
author | Arseniy-Movshev <dodoradio@outlook.com> | 2023-05-28 12:35:47 +0100 |
---|---|---|
committer | Arseniy-Movshev <dodoradio@outlook.com> | 2023-05-28 15:41:14 +0100 |
commit | c212210e41487e88f62d5f8f51c57e63b534c38f (patch) | |
tree | 5b2f3e60ab1e676dedfa6dabc66d413bad5b704c /daemon/logger.cpp | |
parent | 10693b321cc3cbeedb9262dc17282e86d9a13767 (diff) |
Fix up the settings implementation
add interval and enabled settings for all sensors
get rid of some bad duplicates
make sure that application properties are set up before settings are accessed
Diffstat (limited to 'daemon/logger.cpp')
-rw-r--r-- | daemon/logger.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/daemon/logger.cpp b/daemon/logger.cpp index 93f764f..ff62ff6 100644 --- a/daemon/logger.cpp +++ b/daemon/logger.cpp @@ -27,16 +27,19 @@ Logger::Logger(QObject *parent) : QObject(parent){ m_iface = new QDBusInterface("com.nokia.mce","/com/nokia/mce/signal", "com.nokia.mce.signal", QDBusConnection::systemBus()); - QSettings settings; + settings = new QSettings; + + heartrateSensorEnabled = this->settings->value("heartrateSensor/enabled",true).toBool(); + stepCounterEnabled = this->settings->value("stepCounter/enabled",true).toBool(); //intialise HRM - if (heartrateSensorEnabled) { //add check for HRM - m_heartrateSensor = new HeartrateSensorPlugin(this,settings.value("stepsInterval",600000).toInt()); + if (heartrateSensorEnabled) { + m_heartrateSensor = new HeartrateSensorPlugin(this,settings->value("heartrateSensor/interval",600000).toInt()); } //initialise step counter - if (stepCounterEnabled) { //add check for step sensor - m_stepCounter = new StepCounterPlugin(this,settings.value("stepsInterval",600000).toInt()); + if (stepCounterEnabled) { + m_stepCounter = new StepCounterPlugin(this,settings->value("stepCounter/interval",600000).toInt()); } if(!m_iface->isValid()) { |