summaryrefslogtreecommitdiff
path: root/qmlplugin/stepsDataLoader.cpp
diff options
context:
space:
mode:
authorArseniy-Movshev <dodoradio@outlook.com>2023-06-11 13:02:56 +0100
committerArseniy-Movshev <dodoradio@outlook.com>2023-06-20 00:05:28 +0100
commit17af88e65e6cb0febcd2340771f52d128eae4fac (patch)
tree86adb1658412f788ee3b54260102688e52ab6059 /qmlplugin/stepsDataLoader.cpp
parentf6c090502058c63f7a51b7ba97672022657119d8 (diff)
DataLoaders: switch to qvariant for qml compatibility
Diffstat (limited to 'qmlplugin/stepsDataLoader.cpp')
-rw-r--r--qmlplugin/stepsDataLoader.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/qmlplugin/stepsDataLoader.cpp b/qmlplugin/stepsDataLoader.cpp
index 53bdc5e..bbc9b29 100644
--- a/qmlplugin/stepsDataLoader.cpp
+++ b/qmlplugin/stepsDataLoader.cpp
@@ -58,16 +58,16 @@ int StepsDataLoader::getTotalForDate(QDate date) { // This is obvious garbage. T
return line.split(":")[1].toInt();
}
-QList<QPointF> StepsDataLoader::getTodayData() {
+QVariant StepsDataLoader::getTodayData() {
return getDataForDate(QDate::currentDate());
}
-QList<QPointF> StepsDataLoader::getDataForDate(QDate date) {
+QVariant StepsDataLoader::getDataForDate(QDate date) {
QList<QPointF> m_filedata;
QFile file(fileNameForDate(date, "stepCounter"));
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
qDebug() << "failed to open file";
- return m_filedata;
+ return QVariant::fromValue(m_filedata);
}
QTextStream inStream(&file);
QString line;
@@ -79,7 +79,7 @@ QList<QPointF> StepsDataLoader::getDataForDate(QDate date) {
m_filedata.append(point);
}
file.close();
- return m_filedata;
+ return QVariant::fromValue(m_filedata);
}
void StepsDataLoader::triggerDaemonRecording() {