diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-12-05 18:45:15 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-12-05 18:45:15 +0100 |
commit | 7b07235bdc4799f1a87b1989fb84cdc3333892c7 (patch) | |
tree | 5e23bb01e632090a5b1456cd3c098136bb842984 | |
parent | 18996e84ab66c30abb69cae5cb959c624b7d9f0f (diff) | |
parent | b857f611014b8723751be8bc0418399ac62103ec (diff) | |
download | qtlocation-7b07235bdc4799f1a87b1989fb84cdc3333892c7.tar.gz |
Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I337131891ab2ae97be5be999dcab423571c5b30b
-rw-r--r-- | examples/location/mapviewer/mapviewer.pro | 8 | ||||
-rw-r--r-- | examples/location/places/places.pro | 7 | ||||
-rw-r--r-- | examples/location/places_list/places_list.pro | 4 | ||||
-rw-r--r-- | examples/location/places_map/places_map.pro | 4 | ||||
-rw-r--r-- | examples/positioning/logfilepositionsource/logfilepositionsource.pro | 5 | ||||
-rw-r--r-- | src/location/maps/qgeotilecache.cpp | 3 | ||||
-rw-r--r-- | src/plugins/position/geoclue/qgeopositioninfosource_geocluemaster.cpp | 19 |
7 files changed, 27 insertions, 23 deletions
diff --git a/examples/location/mapviewer/mapviewer.pro b/examples/location/mapviewer/mapviewer.pro index 36fead08..8c667498 100644 --- a/examples/location/mapviewer/mapviewer.pro +++ b/examples/location/mapviewer/mapviewer.pro @@ -32,10 +32,12 @@ OTHER_FILES += $$qmlcontentdialogs.files include(../common/common.pri) -target.path = $$[QT_INSTALL_EXAMPLES]/qtlocation/mapviewer - -INSTALLS += target +target.path = $$[QT_INSTALL_EXAMPLES]/location/mapviewer +additional.files = ../common +additional.path = $$[QT_INSTALL_EXAMPLES]/location/common +INSTALLS += target additional +# ensure copying of media file while shadow building !equals($${_PRO_FILE_PWD_}, $${OUT_PWD}) { MEDIAFILE = $${_PRO_FILE_PWD_}/demo.ogv copy2build.input = MEDIAFILE diff --git a/examples/location/places/places.pro b/examples/location/places/places.pro index 459a241e..fa79387d 100644 --- a/examples/location/places/places.pro +++ b/examples/location/places/places.pro @@ -37,7 +37,8 @@ OTHER_FILES += $$qmlcontentplaces.files include(../common/common.pri) -target.path = $$[QT_INSTALL_EXAMPLES]/qtlocation/places - -INSTALLS += target +target.path = $$[QT_INSTALL_EXAMPLES]/location/places +additional.files = ../common +additional.path = $$[QT_INSTALL_EXAMPLES]/location/common +INSTALLS += target additional diff --git a/examples/location/places_list/places_list.pro b/examples/location/places_list/places_list.pro index 2d4b29ab..68a6d494 100644 --- a/examples/location/places_list/places_list.pro +++ b/examples/location/places_list/places_list.pro @@ -6,7 +6,7 @@ SOURCES = main.cpp qmlcontent.files += $$files(*.qml) -target.path = $$[QT_INSTALL_EXAMPLES]/qtlocation/places_list -qmlcontent.path = $$[QT_INSTALL_EXAMPLES]/qtlocation/places_list +target.path = $$[QT_INSTALL_EXAMPLES]/location/places_list +qmlcontent.path = $$[QT_INSTALL_EXAMPLES]/location/places_list INSTALLS += target qmlcontent diff --git a/examples/location/places_map/places_map.pro b/examples/location/places_map/places_map.pro index 5f7d3eaf..7f4bf81b 100644 --- a/examples/location/places_map/places_map.pro +++ b/examples/location/places_map/places_map.pro @@ -7,7 +7,7 @@ SOURCES = main.cpp qmlcontent.files += $$files(*.qml) \ marker.png -target.path = $$[QT_INSTALL_EXAMPLES]/qtlocation/places_map -qmlcontent.path = $$[QT_INSTALL_EXAMPLES]/qtlocation/places_map +target.path = $$[QT_INSTALL_EXAMPLES]/location/places_map +qmlcontent.path = $$[QT_INSTALL_EXAMPLES]/location/places_map INSTALLS += target qmlcontent diff --git a/examples/positioning/logfilepositionsource/logfilepositionsource.pro b/examples/positioning/logfilepositionsource/logfilepositionsource.pro index 59c0d86b..eb492340 100644 --- a/examples/positioning/logfilepositionsource/logfilepositionsource.pro +++ b/examples/positioning/logfilepositionsource/logfilepositionsource.pro @@ -9,7 +9,8 @@ SOURCES = logfilepositionsource.cpp \ clientapplication.cpp \ main.cpp -EXAMPLE_FILES = simplelog.txt target.path = $$[QT_INSTALL_EXAMPLES]/positioning/logfilepositionsource -INSTALLS += target +log.files = simplelog.txt +log.path = $$[QT_INSTALL_EXAMPLES]/positioning/logfilepositionsource +INSTALLS += target log diff --git a/src/location/maps/qgeotilecache.cpp b/src/location/maps/qgeotilecache.cpp index 70709ce5..9bd9c977 100644 --- a/src/location/maps/qgeotilecache.cpp +++ b/src/location/maps/qgeotilecache.cpp @@ -318,8 +318,7 @@ QSharedPointer<QGeoTileTexture> QGeoTileCache::get(const QGeoTileSpec &spec) file.close(); QPixmap pixmap; - const char *format = (parts.size() == 2 ? parts.at(1).toLocal8Bit().constData() : 0); - if (!pixmap.loadFromData(bytes, format)) { + if (!pixmap.loadFromData(bytes, (parts.size() == 2 ? parts.at(1).toLocal8Bit().constData() : 0))) { handleError(spec, QLatin1String("Problem with tile image")); return QSharedPointer<QGeoTileTexture>(0); } diff --git a/src/plugins/position/geoclue/qgeopositioninfosource_geocluemaster.cpp b/src/plugins/position/geoclue/qgeopositioninfosource_geocluemaster.cpp index e9124bcb..fc0b8b99 100644 --- a/src/plugins/position/geoclue/qgeopositioninfosource_geocluemaster.cpp +++ b/src/plugins/position/geoclue/qgeopositioninfosource_geocluemaster.cpp @@ -47,6 +47,7 @@ #include <QtCore/QFile> #include <QtCore/QSaveFile> #include <QtCore/QStandardPaths> +#include <QtCore/QtNumeric> #ifdef Q_LOCATION_GEOCLUE_DEBUG #include <QDebug> @@ -134,6 +135,8 @@ QGeoPositionInfoSourceGeoclueMaster::QGeoPositionInfoSourceGeoclueMaster(QObject m_requestTimer.setSingleShot(true); QObject::connect(&m_requestTimer, SIGNAL(timeout()), this, SLOT(requestUpdateTimeout())); QObject::connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(startUpdatesTimeout())); + + setPreferredPositioningMethods(AllPositioningMethods); } QGeoPositionInfoSourceGeoclueMaster::~QGeoPositionInfoSourceGeoclueMaster() @@ -495,21 +498,19 @@ QGeoPositionInfo QGeoPositionInfoSourceGeoclueMaster::geoclueToPositionInfo( } QGeoPositionInfo info(coordinate, dateTime); if (accuracy) { - double horizontalAccuracy; - double verticalAccuracy; - GeoclueAccuracyLevel accuracyLevel; + double horizontalAccuracy = qQNaN(); + double verticalAccuracy = qQNaN(); + GeoclueAccuracyLevel accuracyLevel = GEOCLUE_ACCURACY_LEVEL_NONE; geoclue_accuracy_get_details(accuracy, &accuracyLevel, &horizontalAccuracy, &verticalAccuracy); #ifdef Q_LOCATION_GEOCLUE_DEBUG qDebug() << "QGeoPositionInfoSourceGeoclueMaster::accuracy horizontal vertical level: " << horizontalAccuracy << verticalAccuracy << accuracyLevel; #endif - if (accuracyLevel & GEOCLUE_ACCURACY_LEVEL_DETAILED) - m_lastPositionFromSatellite = true; - else - m_lastPositionFromSatellite = false; - if (accuracyLevel != GEOCLUE_ACCURACY_LEVEL_NONE) { + m_lastPositionFromSatellite = accuracyLevel & GEOCLUE_ACCURACY_LEVEL_DETAILED; + + if (!qIsNaN(horizontalAccuracy)) info.setAttribute(QGeoPositionInfo::HorizontalAccuracy, horizontalAccuracy); + if (!qIsNaN(verticalAccuracy)) info.setAttribute(QGeoPositionInfo::VerticalAccuracy, verticalAccuracy); - } } return info; } |