From 6a70793ba843549bd8e1921a91a3af0e10702405 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 13 Nov 2015 09:17:13 -0800 Subject: [PATCH] Location service: report number of recorded GPS fixes This is mostly for debugging, to make sure that the recording of GPS fixes works as expected. Signed-off-by: Dirk Hohndel --- qt-mobile/gpslocation.cpp | 5 +++++ qt-mobile/gpslocation.h | 1 + qt-mobile/qmlmanager.cpp | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/qt-mobile/gpslocation.cpp b/qt-mobile/gpslocation.cpp index 2459aeefd..35654b7ff 100644 --- a/qt-mobile/gpslocation.cpp +++ b/qt-mobile/gpslocation.cpp @@ -74,6 +74,11 @@ void GpsLocation::status(QString msg) qmlUiShowMessage(qPrintable(msg)); } +int GpsLocation::getGpsNum() const +{ + return geoSettings.value("count", 0).toInt(); +} + struct gpsTracker { degrees_t latitude; degrees_t longitude; diff --git a/qt-mobile/gpslocation.h b/qt-mobile/gpslocation.h index 9310875d8..044420d08 100644 --- a/qt-mobile/gpslocation.h +++ b/qt-mobile/gpslocation.h @@ -14,6 +14,7 @@ class GpsLocation : QObject public: GpsLocation(QObject *parent); bool applyLocations(); + int getGpsNum() const; private: QGeoPositionInfo lastPos; diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp index 68f22fdc1..d2c105110 100644 --- a/qt-mobile/qmlmanager.cpp +++ b/qt-mobile/qmlmanager.cpp @@ -154,7 +154,8 @@ void QMLManager::applyGpsData() QString QMLManager::logText() const { - return m_logText; + QString logText = m_logText + QString("\nNumer of GPS fixes: %1").arg(locationProvider->getGpsNum()); + return logText; } void QMLManager::setLogText(const QString &logText)