diff options
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/CMakeLists.txt | 2 | ||||
-rw-r--r-- | daemon/logger.cpp | 6 | ||||
-rw-r--r-- | daemon/logger.h | 1 |
3 files changed, 3 insertions, 6 deletions
diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index e38052b..b76527c 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -6,6 +6,8 @@ add_executable(sensorlogd sensorPlugins/stepCounter.h sensorPlugins/heartrateSensor.cpp sensorPlugins/heartrateSensor.h + ../common.cpp + ../common.h ) set_target_properties(sensorlogd PROPERTIES AUTOMOC ON) #add_compile_definitions(Q_DECLARE_PRIVATE_SUPPORTS_UNIQUE_PTR=${Q_DECLARE_PRIVATE_SUPPORTS_UNIQUE_PTR}) diff --git a/daemon/logger.cpp b/daemon/logger.cpp index 76f6e25..e8f75ba 100644 --- a/daemon/logger.cpp +++ b/daemon/logger.cpp @@ -21,6 +21,7 @@ #include <QStandardPaths> #include "logger.h" +#include "../common.h" #include "sensorPlugins/stepCounter.h" #include "sensorPlugins/heartrateSensor.h" @@ -146,11 +147,6 @@ QStringList fileGetPrevRecord(QString sensorPrefix, QDateTime recordTime) { return line.split(":"); } -QString fileNameForDate(QDate date, QString prefix) { - QSettings settings("asteroid","sensorlogd"); //this should be moved out of here at some point TODO - return settings.value("loggerRootPath",QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/.asteroid-sensorlogd/").toString() + prefix + "/" + date.toString("yyyy-MM-dd.log"); -} - void setupFilePath(QString sensorPrefix) { QSettings settings("asteroid","sensorlogd"); //this should be moved out of here at some point TODO QDir::root().mkpath(settings.value("loggerRootPath",QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/.asteroid-sensorlogd/").toString() + sensorPrefix); diff --git a/daemon/logger.h b/daemon/logger.h index 2eff33f..328c0d7 100644 --- a/daemon/logger.h +++ b/daemon/logger.h @@ -50,7 +50,6 @@ private: void fileAddRecord(QString sensorPrefix, QString logdata, QDateTime recordTime = QDateTime::currentDateTime()); //adds a record to today's log file for the given sensor bool dayFileExists(QString sensorPrefix, QDateTime date = QDateTime::currentDateTime()); //check if today has a log file for the given sensor QStringList fileGetPrevRecord(QString sensorPrefix, QDateTime recordTime = QDateTime::currentDateTime()); //works backwards to find the last record in today's file before the given time - returns nothing if no file is found. - QString fileNameForDate(QDate date, QString prefix); void setupFilePath(QString sensorPrefix); //sets up the paths for sensors to write into #endif // LOGGER_H |