summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-10-01 21:57:56 +0200
committerLiang Qi <liang.qi@qt.io>2016-10-01 21:57:57 +0200
commit3f813d1c8c24e5da67d3f096eb3f5c73e760e641 (patch)
treec9fa2a075660ccd3ef3015b2892a61b847cd9288
parent42372ce4c4114f7e38fc5ac681e9199869b4619f (diff)
parent26b2f917861e63091cf97a5acba04d7b813c2fed (diff)
downloadqtlocation-3f813d1c8c24e5da67d3f096eb3f5c73e760e641.tar.gz
Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: I0880e4aa40fbf9fe0bb639f7fd77a52044e91a6e
-rw-r--r--src/plugins/geoservices/nokia/uri_constants.cpp2
-rw-r--r--src/plugins/position/android/src/qgeopositioninfosource_android.cpp33
-rw-r--r--src/plugins/position/android/src/qgeopositioninfosource_android_p.h1
3 files changed, 20 insertions, 16 deletions
diff --git a/src/plugins/geoservices/nokia/uri_constants.cpp b/src/plugins/geoservices/nokia/uri_constants.cpp
index 5d741876..8a075328 100644
--- a/src/plugins/geoservices/nokia/uri_constants.cpp
+++ b/src/plugins/geoservices/nokia/uri_constants.cpp
@@ -37,7 +37,7 @@
QT_BEGIN_NAMESPACE
-const QString ROUTING_HOST = QLatin1String("route.nlp.nokia.com");
+const QString ROUTING_HOST = QLatin1String("route.api.here.com");
const QString GEOCODING_HOST = QLatin1String("loc.desktop.maps.svc.ovi.com");
const QString GEOCODING_HOST_CN = QLatin1String("pr.geo.maps.svc.nokia.com.cn");
const QString PLACES_HOST = QLatin1String("places.api.here.com");
diff --git a/src/plugins/position/android/src/qgeopositioninfosource_android.cpp b/src/plugins/position/android/src/qgeopositioninfosource_android.cpp
index 488c1a70..2c30196e 100644
--- a/src/plugins/position/android/src/qgeopositioninfosource_android.cpp
+++ b/src/plugins/position/android/src/qgeopositioninfosource_android.cpp
@@ -119,26 +119,32 @@ QGeoPositionInfoSource::Error QGeoPositionInfoSourceAndroid::error() const
return m_error;
}
+void QGeoPositionInfoSourceAndroid::setError(Error error)
+{
+ // qDebug() << "setError: " << error;
+ if (error != QGeoPositionInfoSource::NoError)
+ {
+ m_error = error;
+ emit QGeoPositionInfoSource::error(m_error);
+ }
+}
+
void QGeoPositionInfoSourceAndroid::startUpdates()
{
if (updatesRunning)
return;
if (preferredPositioningMethods() == 0) {
- m_error = UnknownSourceError;
- emit QGeoPositionInfoSource::error(m_error);
-
+ setError(UnknownSourceError);
return;
}
updatesRunning = true;
QGeoPositionInfoSource::Error error = AndroidPositioning::startUpdates(androidClassKeyForUpdate);
- //if (error != QGeoPositionInfoSource::NoError) { //TODO
- if (error != 3) {
+ if (error != QGeoPositionInfoSource::NoError)
updatesRunning = false;
- m_error = error;
- emit QGeoPositionInfoSource::error(m_error);
- }
+
+ setError(error);
}
void QGeoPositionInfoSourceAndroid::stopUpdates()
@@ -172,12 +178,10 @@ void QGeoPositionInfoSourceAndroid::requestUpdate(int timeout)
return;
QGeoPositionInfoSource::Error error = AndroidPositioning::requestUpdate(androidClassKeyForSingleRequest);
- //if (error != QGeoPositionInfoSource::NoError) { //TODO
- if (error != 3) {
+ if (error != QGeoPositionInfoSource::NoError)
m_requestTimer.stop();
- m_error = error;
- emit QGeoPositionInfoSource::error(m_error);
- }
+
+ setError(error);
}
void QGeoPositionInfoSourceAndroid::processPositionUpdate(const QGeoPositionInfo &pInfo)
@@ -201,8 +205,7 @@ void QGeoPositionInfoSourceAndroid::processSinglePositionUpdate(const QGeoPositi
void QGeoPositionInfoSourceAndroid::locationProviderDisabled()
{
- m_error = QGeoPositionInfoSource::ClosedError;
- emit QGeoPositionInfoSource::error(m_error);
+ setError(QGeoPositionInfoSource::ClosedError);
}
void QGeoPositionInfoSourceAndroid::requestTimeout()
diff --git a/src/plugins/position/android/src/qgeopositioninfosource_android_p.h b/src/plugins/position/android/src/qgeopositioninfosource_android_p.h
index abfb88cc..dbb27f83 100644
--- a/src/plugins/position/android/src/qgeopositioninfosource_android_p.h
+++ b/src/plugins/position/android/src/qgeopositioninfosource_android_p.h
@@ -84,6 +84,7 @@ private Q_SLOTS:
private:
void reconfigureRunningSystem();
+ void setError(Error error);
bool updatesRunning;
int androidClassKeyForUpdate;