diff options
author | Arseniy-Movshev <dodoradio@outlook.com> | 2023-06-08 14:55:29 +0100 |
---|---|---|
committer | Arseniy-Movshev <dodoradio@outlook.com> | 2023-06-20 00:05:28 +0100 |
commit | a816cfed03b7a02156377c29bd8a77b9c58333db (patch) | |
tree | 4b0d3db87240d94441c493de163a09eff743da2a /qmlplugin | |
parent | 6087e0b0dd7a5246aca9024ef777b62080d35834 (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-- | qmlplugin/CMakeLists.txt | 2 | ||||
-rw-r--r-- | qmlplugin/stepsDataLoader.cpp | 7 | ||||
-rw-r--r-- | qmlplugin/stepsDataLoader.h | 1 |
3 files changed, 3 insertions, 7 deletions
diff --git a/qmlplugin/CMakeLists.txt b/qmlplugin/CMakeLists.txt index 2b36163..3d24374 100644 --- a/qmlplugin/CMakeLists.txt +++ b/qmlplugin/CMakeLists.txt @@ -6,6 +6,8 @@ add_library( stepsDataLoader.h loggerSettings.cpp loggerSettings.h + ../common.cpp + ../common.h ) target_link_libraries(sensorlogdqmlplugin diff --git a/qmlplugin/stepsDataLoader.cpp b/qmlplugin/stepsDataLoader.cpp index 8a281a2..2fbd9f1 100644 --- a/qmlplugin/stepsDataLoader.cpp +++ b/qmlplugin/stepsDataLoader.cpp @@ -13,11 +13,11 @@ #include <QTextStream> #include <QDate> #include <QSettings> -#include <QStandardPaths> #include <QDBusInterface> #include <QPointF> #include "stepsDataLoader.h" +#include "../common.h" StepsDataLoader::StepsDataLoader() : QObject() { @@ -79,8 +79,3 @@ QList<QPointF> StepsDataLoader::getDataForDate(QDate date) { void StepsDataLoader::triggerDaemonRecording() { m_iface->call("triggerRecording"); } - -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"); -} diff --git a/qmlplugin/stepsDataLoader.h b/qmlplugin/stepsDataLoader.h index fa551a3..a1bcb5d 100644 --- a/qmlplugin/stepsDataLoader.h +++ b/qmlplugin/stepsDataLoader.h @@ -29,6 +29,5 @@ public: private: QDBusInterface *m_iface; }; -QString fileNameForDate(QDate date, QString prefix); #endif // STEPSDATALOADER_H |