summaryrefslogtreecommitdiff
path: root/daemon/logger.cpp
diff options
context:
space:
mode:
authorArseniy-Movshev <dodoradio@outlook.com>2023-06-08 14:55:29 +0100
committerArseniy-Movshev <dodoradio@outlook.com>2023-06-20 00:05:28 +0100
commita816cfed03b7a02156377c29bd8a77b9c58333db (patch)
tree4b0d3db87240d94441c493de163a09eff743da2a /daemon/logger.cpp
parent6087e0b0dd7a5246aca9024ef777b62080d35834 (diff)
Move fileNameForDate to a common header file
This function shows up in quite a few places so this seems justified. Other functions may get this treatment later
Diffstat (limited to '')
-rw-r--r--daemon/logger.cpp6
1 files changed, 1 insertions, 5 deletions
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);