[neon/qt/qtlocation/Neon/release] debian: Backport upstream patch to fix position handling in geoclue2 plugin.

Dmitry Shachnev null at kde.org
Thu May 5 11:54:39 BST 2022


Git commit cda5512566fc369eae15a07c422363e5350fd9c4 by Dmitry Shachnev.
Committed on 10/11/2021 at 18:31.
Pushed by jriddell into branch 'Neon/release'.

Backport upstream patch to fix position handling in geoclue2 plugin.

Closes: #996040.

M  +3    -0    debian/changelog
A  +36   -0    debian/patches/geoclue2_fix_position_handling.diff
M  +1    -0    debian/patches/series

https://invent.kde.org/neon/qt/qtlocation/commit/cda5512566fc369eae15a07c422363e5350fd9c4

diff --git a/debian/changelog b/debian/changelog
index bfd7f4e..7c1858d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,8 @@
 qtlocation-opensource-src (5.15.2+dfsg-3) UNRELEASED; urgency=medium
 
+  [ Dmitry Shachnev ]
+  * Backport upstream patch to fix position handling in geoclue2 plugin
+    (closes: #996040).
 
  -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>  Wed, 10 Nov 2021 21:26:56 +0300
 
diff --git a/debian/patches/geoclue2_fix_position_handling.diff b/debian/patches/geoclue2_fix_position_handling.diff
new file mode 100644
index 0000000..83a9879
--- /dev/null
+++ b/debian/patches/geoclue2_fix_position_handling.diff
@@ -0,0 +1,36 @@
+Description: fix position handling in geoclue2 plugin
+ The pre-existing code was incorrect due to the operation priority.
+ The result of the comparison was assigned to the variables, so they
+ were always initialized with 0 or 1 instead of real values.
+ .
+ Also use std::numeric_limits<double>::lowest(), because the altitude
+ can have a negative value (when we are below sea level).
+Origin: upstream, https://code.qt.io/cgit/qt/qtpositioning.git/commit/?id=70b7818e1fc585f8
+Last-Update: 2021-11-10
+
+--- a/src/plugins/position/geoclue2/qgeopositioninfosource_geoclue2.cpp
++++ b/src/plugins/position/geoclue2/qgeopositioninfosource_geoclue2.cpp
+@@ -410,7 +410,8 @@ void QGeoPositionInfoSourceGeoclue2::han
+     } else {
+         QGeoCoordinate coordinate(location.latitude(),
+                                   location.longitude());
+-        if (const auto altitude = location.altitude() > std::numeric_limits<double>::min())
++        const auto altitude = location.altitude();
++        if (altitude > std::numeric_limits<double>::lowest())
+             coordinate.setAltitude(altitude);
+ 
+         const Timestamp ts = location.timestamp();
+@@ -428,9 +429,11 @@ void QGeoPositionInfoSourceGeoclue2::han
+         m_lastPositionFromSatellite = qFuzzyCompare(accuracy, 0.0);
+ 
+         m_lastPosition.setAttribute(QGeoPositionInfo::HorizontalAccuracy, accuracy);
+-        if (const auto speed = location.speed() >= 0.0)
++        const auto speed = location.speed();
++        if (speed >= 0.0)
+             m_lastPosition.setAttribute(QGeoPositionInfo::GroundSpeed, speed);
+-        if (const auto heading = location.heading() >= 0.0)
++        const auto heading = location.heading();
++        if (heading >= 0.0)
+             m_lastPosition.setAttribute(QGeoPositionInfo::Direction, heading);
+ 
+         emit positionUpdated(m_lastPosition);
diff --git a/debian/patches/series b/debian/patches/series
index 7897018..0f50526 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 use_system_dependencies.diff
 hurd_geoclue.diff
 mapboxgl_thread_portability.diff
+geoclue2_fix_position_handling.diff



More information about the Neon-commits mailing list