From 6b58a5676b3ffa288052e638d07c241068930990 Mon Sep 17 00:00:00 2001 From: Arseniy-Movshev Date: Fri, 2 Jun 2023 00:48:12 +0100 Subject: LoggerSettings: fix wrong default sensor intervals This inconsistency suggests that these values should be saved somewhere in a common place --- qmlplugin/loggerSettings.cpp | 56 ++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 23 deletions(-) (limited to 'qmlplugin') diff --git a/qmlplugin/loggerSettings.cpp b/qmlplugin/loggerSettings.cpp index 58bd4b9..3aa987c 100644 --- a/qmlplugin/loggerSettings.cpp +++ b/qmlplugin/loggerSettings.cpp @@ -12,49 +12,59 @@ #include "loggerSettings.h" -LoggerSettings::LoggerSettings() : QObject() { - m_settings = new QSettings("asteroid","sensorlogd"); - m_iface = new QDBusInterface("org.asteroid.sensorlogd.logger","/org/asteroid/sensorlogd/logger","", QDBusConnection::sessionBus(), this); +LoggerSettings::LoggerSettings() + : QObject() +{ + m_settings = new QSettings("asteroid", "sensorlogd"); + m_iface = new QDBusInterface("org.asteroid.sensorlogd.logger", "/org/asteroid/sensorlogd/logger", "", QDBusConnection::sessionBus(), this); if (!m_iface->isValid()) { - qDebug()<<"interface is not valid"; + qDebug() << "interface is not valid"; } else { - qDebug()<<"interface is valid"; + qDebug() << "interface is valid"; } } -void LoggerSettings::reInitLogger() { +void LoggerSettings::reInitLogger() +{ m_iface->call("resetup"); } -bool LoggerSettings::getHeartrateSensorEnabled() { - return this->m_settings->value("heartrateSensor/enabled",true).toBool(); +bool LoggerSettings::getHeartrateSensorEnabled() +{ + return this->m_settings->value("heartrateSensor/enabled", true).toBool(); } -void LoggerSettings::setHeartrateSensorEnabled(bool value) { - this->m_settings->setValue("heartrateSensor/enabled",value); +void LoggerSettings::setHeartrateSensorEnabled(bool value) +{ + this->m_settings->setValue("heartrateSensor/enabled", value); } -int LoggerSettings::getHeartrateSensorInterval() { - return this->m_settings->value("heartrateSensor/interval",60000).toInt(); +int LoggerSettings::getHeartrateSensorInterval() +{ + return this->m_settings->value("heartrateSensor/interval", 600000).toInt(); } -void LoggerSettings::setHeartrateSensorInterval(int value) { - this->m_settings->setValue("heartrateSensor/interval",value); +void LoggerSettings::setHeartrateSensorInterval(int value) +{ + this->m_settings->setValue("heartrateSensor/interval", value); } -bool LoggerSettings::getStepCounterEnabled() { - return this->m_settings->value("stepCounter/enabled",true).toBool(); +bool LoggerSettings::getStepCounterEnabled() +{ + return this->m_settings->value("stepCounter/enabled", true).toBool(); } -void LoggerSettings::setStepCounterEnabled(bool value) { - this->m_settings->setValue("stepCounter/enabled",value); +void LoggerSettings::setStepCounterEnabled(bool value) +{ + this->m_settings->setValue("stepCounter/enabled", value); } -int LoggerSettings::getStepCounterInterval() { - return this->m_settings->value("stepCounter/interval",60000).toInt(); +int LoggerSettings::getStepCounterInterval() +{ + return this->m_settings->value("stepCounter/interval", 600000).toInt(); } -void LoggerSettings::setStepCounterInterval(int value) { - this->m_settings->setValue("stepCounter/interval",value); +void LoggerSettings::setStepCounterInterval(int value) +{ + this->m_settings->setValue("stepCounter/interval", value); } - -- cgit v1.2.3-70-g09d2