summaryrefslogtreecommitdiff
path: root/qmlplugin/stepsDataLoader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qmlplugin/stepsDataLoader.cpp')
-rw-r--r--qmlplugin/stepsDataLoader.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/qmlplugin/stepsDataLoader.cpp b/qmlplugin/stepsDataLoader.cpp
index 0c084ea..199b324 100644
--- a/qmlplugin/stepsDataLoader.cpp
+++ b/qmlplugin/stepsDataLoader.cpp
@@ -14,11 +14,18 @@
#include <QDate>
#include <QSettings>
#include <QStandardPaths>
+#include <QDBusInterface>
#include "stepsDataLoader.h"
StepsDataLoader::StepsDataLoader() : QObject()
{
+ m_iface = new QDBusInterface("org.asteroid.sensorlogd.logger","/org/asteroid/sensorlogd/logger","", QDBusConnection::sessionBus(), this);
+ if (!m_iface->isValid()) {
+ qDebug()<<"interface is not valid";
+ } else {
+ qDebug()<<"interface is valid";
+ }
}
int StepsDataLoader::getTodayData() {
@@ -45,6 +52,11 @@ int StepsDataLoader::getDataForDate(QDate date) { // This is obvious garbage. Th
return line.split(":")[1].toInt();
}
+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");