From b1f90b6aa0171cc5a5b7b5ff2f8dbc6236e23c4e Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 8 Jan 2016 23:18:41 -0800 Subject: QML UI: partial, slow and incomplete implementation of delete GPS fix This only deletes the fix on the mobile device, not on the server. And it is really really slow. Re-reading the data from the settings just isn't a smart way to do this. Signed-off-by: Dirk Hohndel --- qt-mobile/qml/GpsList.qml | 1 + qt-mobile/qmlmanager.cpp | 7 +++++++ qt-mobile/qmlmanager.h | 1 + 3 files changed, 9 insertions(+) (limited to 'qt-mobile') diff --git a/qt-mobile/qml/GpsList.qml b/qt-mobile/qml/GpsList.qml index 1e3242e6d..0ee654fc1 100644 --- a/qt-mobile/qml/GpsList.qml +++ b/qt-mobile/qml/GpsList.qml @@ -91,6 +91,7 @@ MobileComponents.Page { iconName: "trash-empty" onTriggered: { print("delete this!") + manager.deleteGpsFix(when) } }, Action { diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp index 1d68dc3a7..df20de11d 100644 --- a/qt-mobile/qmlmanager.cpp +++ b/qt-mobile/qmlmanager.cpp @@ -528,6 +528,13 @@ void QMLManager::clearGpsData() populateGpsData(); } +void QMLManager::deleteGpsFix(quint64 when) +{ + locationProvider->deleteGpsFix(when); + populateGpsData(); +} + + QString QMLManager::logText() const { QString logText = m_logText + QString("\nNumer of GPS fixes: %1").arg(locationProvider->getGpsNum()); diff --git a/qt-mobile/qmlmanager.h b/qt-mobile/qmlmanager.h index ebc33abf9..05dae9925 100644 --- a/qt-mobile/qmlmanager.h +++ b/qt-mobile/qmlmanager.h @@ -85,6 +85,7 @@ public slots: QString getNumber(QString diveId); QString getDate(QString diveId); QString getCurrentPosition(); + void deleteGpsFix(quint64 when); private: QString m_cloudUserName; -- cgit v1.2.3-70-g09d2