diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2016-01-08 23:18:41 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-01-08 23:18:41 -0800 |
commit | b1f90b6aa0171cc5a5b7b5ff2f8dbc6236e23c4e (patch) | |
tree | f75d68234e4de76fcd8deaf9172f6516dbc951b0 /qt-mobile | |
parent | 038cfcba911f2ae0e22ef6138042a6154578723c (diff) | |
download | subsurface-b1f90b6aa0171cc5a5b7b5ff2f8dbc6236e23c4e.tar.gz |
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 <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile')
-rw-r--r-- | qt-mobile/qml/GpsList.qml | 1 | ||||
-rw-r--r-- | qt-mobile/qmlmanager.cpp | 7 | ||||
-rw-r--r-- | qt-mobile/qmlmanager.h | 1 |
3 files changed, 9 insertions, 0 deletions
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; |