summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2014-08-14 13:04:42 +0200
committerAlex Blasche <alexander.blasche@digia.com>2014-08-14 13:04:58 +0200
commitd34d3e421bb998777c11265ec9db1f239bd9bdb1 (patch)
tree6e5156243d048c9a7a31982b1a562d1a87bc7123
parentf55ae20fa3216e0fcaa7973b047ac5688e2c50bc (diff)
parenta36d9e67e3b8168cb4d1eb76eda96ebb8242fd20 (diff)
downloadqtlocation-d34d3e421bb998777c11265ec9db1f239bd9bdb1.tar.gz
Merge branch '5.3' into 5.4
Change-Id: I02ab19530354f656823e59bb43a6fc4786b2f189
-rw-r--r--dist/changes-5.3.250
-rw-r--r--examples/positioning/weatherinfo/appmodel.cpp17
-rw-r--r--examples/positioning/weatherinfo/appmodel.h3
-rw-r--r--src/plugins/position/geoclue/qgeopositioninfosource_geocluemaster.cpp31
-rw-r--r--src/plugins/position/geoclue/qgeopositioninfosource_geocluemaster_p.h3
-rw-r--r--tests/auto/declarative_core/tst_positionsource.qml1
-rw-r--r--tests/auto/qgeopositioninfosource/testqgeopositioninfosource.cpp2
7 files changed, 96 insertions, 11 deletions
diff --git a/dist/changes-5.3.2 b/dist/changes-5.3.2
new file mode 100644
index 00000000..b1981f67
--- /dev/null
+++ b/dist/changes-5.3.2
@@ -0,0 +1,50 @@
+Qt 5.3.2 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.3.0 and Qt 5.3.1.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+ http://qt-project.org/doc/qt-5.3
+
+The Qt version 5.3 series is binary compatible with the 5.2.x series.
+Applications compiled for 5.2 will continue to run with 5.3.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+ http://bugreports.qt-project.org/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* Library *
+****************************************************************************
+
+QtPositioning
+-------------
+
+ - [QTBUG-39843] [iOS] Fixed link error of positioncl and positionpoll
+ plug-in.
+
+ - [QTBUG-40198] Fixed symbol clash between sensor and position plug-in.
+ This happened when using static builds of Qt (e.g. on iOS) and the
+ application used QtSensors and QtPositioning at the same time.
+
+ - Improved weatherinfo example to not hang on the "Loading weather data"
+ screen if the current QGeoPositionInfoSource instance returned an error
+ during its startup.
+
+****************************************************************************
+* Platform Specific Changes *
+****************************************************************************
+
+[iOS]
+
+ - [QTBUG-38300] Fixed wrong value of QGeoPositionInfo attributes if those
+ attributes were not provided by the platforms CoreLocation framework.
+
+[Linux]
+
+ - [QTBUG-40425] Fixed missing error report when failing to connect to GeoClue.
+
diff --git a/examples/positioning/weatherinfo/appmodel.cpp b/examples/positioning/weatherinfo/appmodel.cpp
index d0a37265..30d990d4 100644
--- a/examples/positioning/weatherinfo/appmodel.cpp
+++ b/examples/positioning/weatherinfo/appmodel.cpp
@@ -233,6 +233,8 @@ void AppModel::networkSessionOpened()
d->useGps = true;
connect(d->src, SIGNAL(positionUpdated(QGeoPositionInfo)),
this, SLOT(positionUpdated(QGeoPositionInfo)));
+ connect(d->src, SIGNAL(error(QGeoPositionInfoSource::Error)),
+ this, SLOT(positionError(QGeoPositionInfoSource::Error)));
d->src->startUpdates();
} else {
d->useGps = false;
@@ -277,6 +279,21 @@ void AppModel::positionUpdated(QGeoPositionInfo gpsPos)
d->geoReplyMapper, SLOT(map()));
}
+void AppModel::positionError(QGeoPositionInfoSource::Error e)
+{
+ qWarning() << "Position source error. Falling back to simulation mode.";
+ // cleanup insufficient QGeoPositionInfoSource instance
+ d->src->stopUpdates();
+ d->src->deleteLater();
+ d->src = 0;
+
+ // activate simulation mode
+ d->useGps = false;
+ d->city = "Brisbane";
+ emit cityChanged();
+ this->refreshWeather();
+}
+
void AppModel::handleGeoNetworkData(QObject *replyObj)
{
QNetworkReply *networkReply = qobject_cast<QNetworkReply*>(replyObj);
diff --git a/examples/positioning/weatherinfo/appmodel.h b/examples/positioning/weatherinfo/appmodel.h
index e0d32148..16297236 100644
--- a/examples/positioning/weatherinfo/appmodel.h
+++ b/examples/positioning/weatherinfo/appmodel.h
@@ -46,7 +46,7 @@
#include <QtNetwork/QNetworkReply>
#include <QtQml/QQmlListProperty>
-#include <qgeopositioninfo.h>
+#include <QtPositioning/QGeoPositionInfoSource>
//! [0]
class WeatherData : public QObject {
@@ -146,6 +146,7 @@ public slots:
private slots:
void networkSessionOpened();
void positionUpdated(QGeoPositionInfo gpsPos);
+ void positionError(QGeoPositionInfoSource::Error e);
// these would have QNetworkReply* params but for the signalmapper
void handleGeoNetworkData(QObject *networkReply);
void handleWeatherNetworkData(QObject *networkReply);
diff --git a/src/plugins/position/geoclue/qgeopositioninfosource_geocluemaster.cpp b/src/plugins/position/geoclue/qgeopositioninfosource_geocluemaster.cpp
index 0b4c1414..8e6e1b61 100644
--- a/src/plugins/position/geoclue/qgeopositioninfosource_geocluemaster.cpp
+++ b/src/plugins/position/geoclue/qgeopositioninfosource_geocluemaster.cpp
@@ -115,7 +115,7 @@ QGeoPositionInfoSourceGeoclueMaster::QGeoPositionInfoSourceGeoclueMaster(QObject
: QGeoPositionInfoSource(parent), QGeoclueMaster(this), m_pos(0), m_vel(0),
m_lastVelocityIsFresh(false), m_regularUpdateTimedOut(false), m_lastVelocity(qQNaN()),
m_lastDirection(qQNaN()), m_lastClimb(qQNaN()), m_lastPositionFromSatellite(false),
- m_methods(AllPositioningMethods), m_running(false)
+ m_methods(AllPositioningMethods), m_running(false), m_error(NoError)
{
#ifndef QT_NO_DATASTREAM
// Load the last known location
@@ -497,25 +497,42 @@ void QGeoPositionInfoSourceGeoclueMaster::positionProviderChanged(const QByteArr
}
}
-bool QGeoPositionInfoSourceGeoclueMaster::configurePositionSource()
+void QGeoPositionInfoSourceGeoclueMaster::configurePositionSource()
{
+ GeoclueAccuracyLevel accuracy;
+ GeoclueResourceFlags resourceFlags;
+
switch (preferredPositioningMethods()) {
case SatellitePositioningMethods:
- return createMasterClient(GEOCLUE_ACCURACY_LEVEL_DETAILED, GEOCLUE_RESOURCE_GPS);
+ accuracy = GEOCLUE_ACCURACY_LEVEL_DETAILED;
+ resourceFlags = GEOCLUE_RESOURCE_GPS;
+ break;
case NonSatellitePositioningMethods:
- return createMasterClient(GEOCLUE_ACCURACY_LEVEL_NONE, GeoclueResourceFlags(GEOCLUE_RESOURCE_CELL | GEOCLUE_RESOURCE_NETWORK));
+ accuracy = GEOCLUE_ACCURACY_LEVEL_NONE;
+ resourceFlags = GeoclueResourceFlags(GEOCLUE_RESOURCE_CELL | GEOCLUE_RESOURCE_NETWORK);
+ break;
case AllPositioningMethods:
- return createMasterClient(GEOCLUE_ACCURACY_LEVEL_NONE, GEOCLUE_RESOURCE_ALL);
+ accuracy = GEOCLUE_ACCURACY_LEVEL_NONE;
+ resourceFlags = GEOCLUE_RESOURCE_ALL;
+ break;
default:
qWarning("GeoPositionInfoSourceGeoClueMaster unknown preferred method.");
+ m_error = UnknownSourceError;
+ emit QGeoPositionInfoSource::error(m_error);
+ return;
}
- return false;
+ if (createMasterClient(accuracy, resourceFlags)) {
+ m_error = NoError;
+ } else {
+ m_error = UnknownSourceError;
+ emit QGeoPositionInfoSource::error(m_error);
+ }
}
QGeoPositionInfoSource::Error QGeoPositionInfoSourceGeoclueMaster::error() const
{
- return NoError;
+ return m_error;
}
#include "moc_qgeopositioninfosource_geocluemaster_p.cpp"
diff --git a/src/plugins/position/geoclue/qgeopositioninfosource_geocluemaster_p.h b/src/plugins/position/geoclue/qgeopositioninfosource_geocluemaster_p.h
index 3f88334a..193c9765 100644
--- a/src/plugins/position/geoclue/qgeopositioninfosource_geocluemaster_p.h
+++ b/src/plugins/position/geoclue/qgeopositioninfosource_geocluemaster_p.h
@@ -101,7 +101,7 @@ private slots:
void positionProviderChanged(const QByteArray &service, const QByteArray &path);
private:
- bool configurePositionSource();
+ void configurePositionSource();
void cleanupPositionSource();
void setOptions();
@@ -118,6 +118,7 @@ private:
QGeoPositionInfo m_lastPosition;
PositioningMethods m_methods;
bool m_running;
+ QGeoPositionInfoSource::Error m_error;
};
QT_END_NAMESPACE
diff --git a/tests/auto/declarative_core/tst_positionsource.qml b/tests/auto/declarative_core/tst_positionsource.qml
index 9984e783..195dd124 100644
--- a/tests/auto/declarative_core/tst_positionsource.qml
+++ b/tests/auto/declarative_core/tst_positionsource.qml
@@ -73,7 +73,6 @@ TestCase {
// at least the test.source plugin should be available
verify(defaultSource.name != "");
compare(defaultSource.active, false);
- compare(defaultSource.updateInterval, 0);
}
function test_inactive() {
diff --git a/tests/auto/qgeopositioninfosource/testqgeopositioninfosource.cpp b/tests/auto/qgeopositioninfosource/testqgeopositioninfosource.cpp
index bd45cfac..b2517c29 100644
--- a/tests/auto/qgeopositioninfosource/testqgeopositioninfosource.cpp
+++ b/tests/auto/qgeopositioninfosource/testqgeopositioninfosource.cpp
@@ -113,7 +113,7 @@ class DefaultSourceTest : public TestQGeoPositionInfoSource
Q_OBJECT
protected:
QGeoPositionInfoSource *createTestSource() {
- return QGeoPositionInfoSource::createDefaultSource(0);
+ return QGeoPositionInfoSource::createSource(QStringLiteral("test.source"), 0);
}
};