aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/gpslocation.cpp8
-rw-r--r--core/gpslocation.h3
2 files changed, 10 insertions, 1 deletions
diff --git a/core/gpslocation.cpp b/core/gpslocation.cpp
index 3866fdc8a..29a8827af 100644
--- a/core/gpslocation.cpp
+++ b/core/gpslocation.cpp
@@ -66,6 +66,7 @@ QGeoPositionInfoSource *GpsLocation::getGpsSource()
status(QString("Created position source %1").arg(m_GpsSource->sourceName()));
connect(m_GpsSource, SIGNAL(positionUpdated(QGeoPositionInfo)), this, SLOT(newPosition(QGeoPositionInfo)));
connect(m_GpsSource, SIGNAL(updateTimeout()), this, SLOT(updateTimeout()));
+ connect(m_GpsSource, SIGNAL(error(QGeoPositionInfoSource::Error)), this, SLOT(positionSourceError(QGeoPositionInfoSource::Error)));
m_GpsSource->setUpdateInterval(5 * 60 * 1000); // 5 minutes so the device doesn't drain the battery
} else {
#ifdef SUBSURFACE_MOBILE
@@ -154,6 +155,13 @@ void GpsLocation::updateTimeout()
status("request to get new position timed out");
}
+void GpsLocation::positionSourceError(QGeoPositionInfoSource::Error)
+{
+ status("error receiving a GPS location");
+ haveSource = NOGPS;
+ emit haveSourceChanged();
+}
+
void GpsLocation::status(QString msg)
{
qDebug() << msg;
diff --git a/core/gpslocation.h b/core/gpslocation.h
index c6e4a7912..0e333ed82 100644
--- a/core/gpslocation.h
+++ b/core/gpslocation.h
@@ -20,7 +20,7 @@ struct gpsTracker {
int idx;
};
-class GpsLocation : QObject {
+class GpsLocation : public QObject {
Q_OBJECT
public:
GpsLocation(void (*showMsgCB)(const char *msg), QObject *parent);
@@ -61,6 +61,7 @@ public slots:
void serviceEnable(bool toggle);
void newPosition(QGeoPositionInfo pos);
void updateTimeout();
+ void positionSourceError(QGeoPositionInfoSource::Error error);
void uploadToServer();
void downloadFromServer();
void postError(QNetworkReply::NetworkError error);