From 577da54454e83e448b3a9ba912b4ba58fa64d3ab Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 13 Nov 2015 17:20:45 -0800 Subject: Location service: add ability to delete all stored GPS fixes This may need an "are you sure" confirmation dialog... Signed-off-by: Dirk Hohndel --- qt-mobile/gpslocation.cpp | 6 ++++++ qt-mobile/gpslocation.h | 1 + qt-mobile/qml/main.qml | 7 +++++++ qt-mobile/qmlmanager.cpp | 5 +++++ 4 files changed, 19 insertions(+) (limited to 'qt-mobile') diff --git a/qt-mobile/gpslocation.cpp b/qt-mobile/gpslocation.cpp index 3139a4315..f2bde130d 100644 --- a/qt-mobile/gpslocation.cpp +++ b/qt-mobile/gpslocation.cpp @@ -209,3 +209,9 @@ bool GpsLocation::applyLocations() } } } + +void GpsLocation::clearGpsData() +{ + geoSettings->clear(); + geoSettings->sync(); +} diff --git a/qt-mobile/gpslocation.h b/qt-mobile/gpslocation.h index a279593d5..a8437cca2 100644 --- a/qt-mobile/gpslocation.h +++ b/qt-mobile/gpslocation.h @@ -28,6 +28,7 @@ public slots: void serviceEnable(bool toggle); void newPosition(QGeoPositionInfo pos); void updateTimeout(); + void clearGpsData(); }; #endif // GPSLOCATION_H diff --git a/qt-mobile/qml/main.qml b/qt-mobile/qml/main.qml index 3e18cbc68..d4b01cb33 100644 --- a/qt-mobile/qml/main.qml +++ b/qt-mobile/qml/main.qml @@ -86,6 +86,13 @@ ApplicationWindow { } } + MenuItem { + text: "Clear stored GPS data" + onTriggered: { + manager.clearGpsData(); + } + } + MenuItem { text: "View Log" onTriggered: { diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp index c00134f84..63de7d6e8 100644 --- a/qt-mobile/qmlmanager.cpp +++ b/qt-mobile/qmlmanager.cpp @@ -158,6 +158,11 @@ void QMLManager::applyGpsData() locationProvider->applyLocations(); } +void QMLManager::clearGpsData() +{ + locationProvider->clearGpsData(); +} + QString QMLManager::logText() const { QString logText = m_logText + QString("\nNumer of GPS fixes: %1").arg(locationProvider->getGpsNum()); -- cgit v1.2.3-70-g09d2