From 9783cdd14fdd835d4bdc92d6cf933cd9cf7a9009 Mon Sep 17 00:00:00 2001 From: Ivan Solovev Date: Tue, 4 May 2021 18:48:55 +0200 Subject: QtPositioning: fix source detection When an 'nmeaSource' property is specified, it is read before the component is completed. At this point, a valid position source can be created to read the data from the specified source. After that, when the component is completed, a new position source is created based on the 'name' property, even if it's empty. This results in the initial valid position source being overridden by a default one (depending on the system configuration it may or may not provide valid positioning information). This patch adds a check that if nmeaSource is used, we do not try to override it and ignore the 'name' property. Fixes: QTBUG-85636 Change-Id: I6acdcdaf7c7f8ee168c1d48d9eb5dbc7d1838af3 Reviewed-by: Qt CI Bot Reviewed-by: Alex Blasche --- src/positioningquick/qdeclarativepositionsource.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/positioningquick/qdeclarativepositionsource.cpp b/src/positioningquick/qdeclarativepositionsource.cpp index 599bb29b..af1e9904 100644 --- a/src/positioningquick/qdeclarativepositionsource.cpp +++ b/src/positioningquick/qdeclarativepositionsource.cpp @@ -193,6 +193,12 @@ void QDeclarativePositionSource::setName(const QString &newName) */ void QDeclarativePositionSource::tryAttach(const QString &newName, bool useFallback) { + if (m_nmeaFile != nullptr || m_nmeaSocket != nullptr) { + if (!m_providerName.isEmpty()) + qWarning("Both nmeaSource and name parameters are specified. nmeaSource will be used."); + return; + } + const QString previousName = name(); const bool sourceExisted = m_positionSource; m_providerName = newName; -- cgit v1.2.1 From cc1f53102d3bf7df4e7f6da3348a704cfd309ee7 Mon Sep 17 00:00:00 2001 From: Tarja Sundqvist Date: Thu, 20 May 2021 14:47:28 +0300 Subject: Bump version Change-Id: I91889722a2ed2be2c7d9deb73b9e435c5fdc8ac5 --- .qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.qmake.conf b/.qmake.conf index 398f6638..062d6124 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -3,7 +3,7 @@ CONFIG += warning_clean DEFINES += QT_NO_JAVA_STYLE_ITERATORS QT_NO_LINKED_LIST -MODULE_VERSION = 5.15.4 +MODULE_VERSION = 5.15.5 # Adds a way to debug location. The define is needed for multiple subprojects as they # include the essential headers. -- cgit v1.2.1