This was created by checking out qtlocation and checking out the kf5
patches from kde.  For more details of those, see
https://dot.kde.org/2021/04/06/announcing-kdes-qt-5-patch-collection

from kde:
 git clone https://invent.kde.org/qt/qt/qtlocation
 cd qtwayland
 git checkout -t origin/5.15
 git format-patch origin/5.15.2..origin/kde/5.15

To update for new patches, git pull and then rerun git format-patch.

Last updated: 2021-01-25

Following patches commented:
0001-Bump-version.patch  not wanted
0002-Fix-crash-when-showing-Map-QML-comp.-for-2nd-time.patch  already applied
0003-Add-changes-file-for-Qt-5.15.2.patch  already applied

#From 3e366ddf164acd9764f5d66658426d05460d3403 Mon Sep 17 00:00:00 2001
#From: Jani Heikkinen <jani.heikkinen@qt.io>
#Date: Tue, 27 Oct 2020 07:48:44 +0200
#Subject: [PATCH 1/6] Bump version
#
#Change-Id: Id255515e0754d1905073ed1ec03ca75ad56c41de
#---
# .qmake.conf | 2 +-
# 1 file changed, 1 insertion(+), 1 deletion(-)
#
#diff --git a/.qmake.conf b/.qmake.conf
#index 6db874a2..8dceae8e 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.2
#+MODULE_VERSION = 5.15.3
# 
# # Adds a way to debug location. The define is needed for multiple subprojects as they
# # include the essential headers.
#-- 
#2.33.0
#
From 4fe9e0ed027134a833b2243597a2ccd00987b559 Mon Sep 17 00:00:00 2001
From: Piotr Mikolajczyk <piotr.mikolajczyk@qt.io>
Date: Tue, 29 Sep 2020 10:41:23 +0200
Subject: [PATCH 2/6] Fix crash when showing Map QML comp. for 2nd+ time

Crash caused by storing pointer to a node that could be deleted elsewhere

Fixes: QTBUG-85260
Change-Id: I871123322fac84b8bf91e9bab8ecad08e75c2854
Reviewed-by: Paolo Angelelli <paolo.angelelli.qt@gmail.com>
---
 .../labs/qsg/qgeomapobjectqsgsupport.cpp      | 29 ++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/src/location/labs/qsg/qgeomapobjectqsgsupport.cpp b/src/location/labs/qsg/qgeomapobjectqsgsupport.cpp
index 0e1df8f6..cd180130 100644
--- a/src/location/labs/qsg/qgeomapobjectqsgsupport.cpp
+++ b/src/location/labs/qsg/qgeomapobjectqsgsupport.cpp
@@ -48,7 +48,32 @@ static int findMapObject(QGeoMapObject *o, const QList<MapObject> &list)
     }
     return -1;
 }
+namespace  {
+bool findNodeInStructure(QSGNode *root, QSGNode *item)
+{
+    if (root == nullptr || item == nullptr)
+        return false;
+    if (root == item)
+        return true;
+    auto currentChild = root->firstChild();
+    // First check the direct child nodes and if not found let's dive deeper
+    bool bFound = (item == currentChild);
+
+    while (!bFound && currentChild) {
+        currentChild = currentChild->nextSibling();
+        bFound = (item == currentChild);
+    }
 
+    if (!bFound) {
+        currentChild = root->firstChild();
+        while (!bFound && currentChild) {
+            bFound = findNodeInStructure(currentChild, item);
+            currentChild = currentChild->nextSibling();
+        }
+    }
+    return bFound;
+}
+}
 bool QGeoMapObjectQSGSupport::createMapObjectImplementation(QGeoMapObject *obj, QGeoMapPrivate *d)
 {
     QExplicitlySharedDataPointer<QGeoMapObjectPrivate> pimpl =
@@ -157,9 +182,11 @@ void QGeoMapObjectQSGSupport::updateMapObjects(QSGNode *root, QQuickWindow *wind
 {
     if (!root)
         return;
+    if (!findNodeInStructure(root, m_mapObjectsRootNode))
+         m_mapObjectsRootNode = nullptr;
     if (!m_mapObjectsRootNode) {
         m_mapObjectsRootNode = new QDeclarativePolygonMapItemPrivateOpenGL::RootNode();
-        root->appendChildNode(m_mapObjectsRootNode);
+        root->appendChildNode(m_mapObjectsRootNode); // PASSING OWNERSHIP!
     }
 
     m_mapObjectsRootNode->removeAllChildNodes();
-- 
2.33.0

#From 03acfd3518edaadc4afccf5e3c077f078e4bf372 Mon Sep 17 00:00:00 2001
#From: Antti Kokko <antti.kokko@qt.io>
#Date: Tue, 27 Oct 2020 10:02:12 +0200
#Subject: [PATCH 3/6] Add changes file for Qt 5.15.2
#
#- 4ea38f51051adb290e414981e3dc2be67d50fcab Add changes file for Qt 5.15.1
#+ 3e9d5379f4db89413cb50e928857dbd852755087 Add actual text of Boost Software License
#+ 4fdb479bbbb946d825b7d908527651c4bf37091c Update src/3rdparty/mapbox-gl-native
#+ 64c608f72f0ffe253d37eefb56b465e70465bb05 Use RedirectPolicyAttribute instead of FollowRedirectsAttribute
#+ 023d51d8bea80771db1f2767a0bc6ff98e16ae71 Bump version
#+ 9ac778b23aa77c62470efcd6bb3afe57576c0aa7 Make names of poly2tri, clipper, clip2tri libraries unique
#
#Change-Id: I728895c80ec546017a2dfc2bd1fd112e06257ddf
#Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
#(cherry picked from commit 02a21217a9706402802f38c646797be8eccb86e4)
#Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
#---
# dist/changes-5.15.2 | 48 +++++++++++++++++++++++++++++++++++++++++++++
# 1 file changed, 48 insertions(+)
# create mode 100644 dist/changes-5.15.2
#
#diff --git a/dist/changes-5.15.2 b/dist/changes-5.15.2
#new file mode 100644
#index 00000000..1e669062
#--- /dev/null
#+++ b/dist/changes-5.15.2
#@@ -0,0 +1,48 @@
#+Qt 5.15.2 is a bug-fix release. It maintains both forward and backward
#+compatibility (source and binary) with Qt 5.15.1.
#+
#+For more details, refer to the online documentation included in this
#+distribution. The documentation is also available online:
#+
#+  https://doc.qt.io/qt-5.15/index.html
#+
#+The Qt version 5.15 series is binary compatible with the 5.14.x series.
#+Applications compiled for 5.14 will continue to run with 5.15.
#+
#+Some of the changes listed in this file include issue tracking numbers
#+corresponding to tasks in the Qt Bug Tracker:
#+
#+  https://bugreports.qt.io/
#+
#+Each of these identifiers can be entered in the bug tracker to obtain more
#+information about a particular change.
#+
#+****************************************************************************
#+*                   Important Behavior Changes                             *
#+****************************************************************************
#+
#+****************************************************************************
#+*                          Library                                         *
#+****************************************************************************
#+
#+
#+General
#+-------
#+
#+ - [QTBUG-86248] The generated clipper2tri, clipper, poly2tri libraries have
#+   been renamed to qt_clipper2tri, qt_clipper, qt_poly2tri. This avoids
#+   conflicts for static builds.
#+
#+Third-Party Code
#+----------------
#+
#+ - Update and extend third-party documentation for Mapbox GL plugin
#+   dependencies: libc++, Optional, Mapbox GL Native, Boost, CSS Color Parser,
#+   cURL Parse Date, Earcut Polygon Triangulation Library, geojson-cpp,
#+   geojson-vt-cpp, geometry.hpp, kdbush.hpp, polylabel, protozero, RapidJSON,
#+   shelf-pack-cpp, supercluster.hpp, tao_tuple, unique_resource, variant,
#+   Vector Tile Library, Wagyu Geometry Processing Library, nunicode.
#+
#+ - Added actual license text of Boost Software License (used in Clipper Polygon
#+   Clipping Library)
#+
#-- 
#2.33.0
#
From bf8075b3e11f7e33dd5c1197066e2f5f7a6e2d72 Mon Sep 17 00:00:00 2001
From: Vyacheslav Koscheev <v.koscheev@2gis.ru>
Date: Wed, 14 Oct 2020 10:19:42 +0700
Subject: [PATCH 4/6] Android: fix Location properties

According to android doc getAltitude, getAccuracy,
getVerticalAccuracyMeters, getSpeed, getBearing &
getAltitude returns 0.0 if location does not have this value.
Corresponding has* method can return false positive on some devices.
e.g. Huawei P20 Pro

Change-Id: I887412cf2cff05414de08c774947d969fc69aa92
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
---
 .../position/android/src/jnipositioning.cpp   | 25 +++++++++++++++----
 1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/src/plugins/position/android/src/jnipositioning.cpp b/src/plugins/position/android/src/jnipositioning.cpp
index 05b25d98..a9fe6ae7 100644
--- a/src/plugins/position/android/src/jnipositioning.cpp
+++ b/src/plugins/position/android/src/jnipositioning.cpp
@@ -223,7 +223,10 @@ namespace AndroidPositioning {
         if (attributeExists) {
             mid = getCachedMethodID(jniEnv, thisClass, "getAltitude", "()D");
             jdouble value = jniEnv->CallDoubleMethod(location, mid);
-            coordinate.setAltitude(value);
+            if (value != 0.0)
+            {
+                coordinate.setAltitude(value);
+            }
         }
 
         info.setCoordinate(coordinate);
@@ -239,7 +242,10 @@ namespace AndroidPositioning {
         if (attributeExists) {
             mid = getCachedMethodID(jniEnv, thisClass, "getAccuracy", "()F");
             jfloat accuracy = jniEnv->CallFloatMethod(location, mid);
-            info.setAttribute(QGeoPositionInfo::HorizontalAccuracy, qreal(accuracy));
+            if (accuracy != 0.0)
+            {
+                info.setAttribute(QGeoPositionInfo::HorizontalAccuracy, qreal(accuracy));
+            }
         }
 
         //vertical accuracy
@@ -250,7 +256,10 @@ namespace AndroidPositioning {
                 mid = getCachedMethodID(jniEnv, thisClass, "getVerticalAccuracyMeters", "()F");
                 if (mid) {
                     jfloat accuracy = jniEnv->CallFloatMethod(location, mid);
-                    info.setAttribute(QGeoPositionInfo::VerticalAccuracy, qreal(accuracy));
+                    if (accuracy != 0.0)
+                    {
+                        info.setAttribute(QGeoPositionInfo::VerticalAccuracy, qreal(accuracy));
+                    }
                 }
             }
         }
@@ -264,7 +273,10 @@ namespace AndroidPositioning {
         if (attributeExists) {
             mid = getCachedMethodID(jniEnv, thisClass, "getSpeed", "()F");
             jfloat speed = jniEnv->CallFloatMethod(location, mid);
-            info.setAttribute(QGeoPositionInfo::GroundSpeed, qreal(speed));
+            if (speed != 0)
+            {
+                info.setAttribute(QGeoPositionInfo::GroundSpeed, qreal(speed));
+            }
         }
 
         //bearing
@@ -273,7 +285,10 @@ namespace AndroidPositioning {
         if (attributeExists) {
             mid = getCachedMethodID(jniEnv, thisClass, "getBearing", "()F");
             jfloat bearing = jniEnv->CallFloatMethod(location, mid);
-            info.setAttribute(QGeoPositionInfo::Direction, qreal(bearing));
+            if (bearing != 0.0)
+            {
+                info.setAttribute(QGeoPositionInfo::Direction, qreal(bearing));
+            }
         }
 
         jniEnv->DeleteLocalRef(thisClass);
-- 
2.33.0

From f7a270142eef06eb493a2f6b544c4ea66c9d5c23 Mon Sep 17 00:00:00 2001
From: Edward Welbourne <edward.welbourne@qt.io>
Date: Thu, 22 Oct 2020 19:09:07 +0200
Subject: [PATCH 5/6] Use QLocale::NorwegianBokmal rather than Norwegian

The short form is a deprecated alias and going away.

Change-Id: I6b095f61a798e8559043cbeac75cd27176a45196
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
---
 tests/auto/qplacemanager/tst_qplacemanager.cpp                  | 2 +-
 .../qplacemanager_unsupported/tst_qplacemanager_unsupported.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/auto/qplacemanager/tst_qplacemanager.cpp b/tests/auto/qplacemanager/tst_qplacemanager.cpp
index 2cb035cd..919be2d9 100644
--- a/tests/auto/qplacemanager/tst_qplacemanager.cpp
+++ b/tests/auto/qplacemanager/tst_qplacemanager.cpp
@@ -108,7 +108,7 @@ void tst_QPlaceManager::testLocales()
     QCOMPARE(placeManager->locales().count(), 1);
     QCOMPARE(placeManager->locales().at(0), QLocale());
 
-    QLocale locale(QLocale::Norwegian, QLocale::Norway);
+    QLocale locale(QLocale::NorwegianBokmal, QLocale::Norway);
     placeManager->setLocale(locale);
 
     QCOMPARE(placeManager->locales().at(0), locale);
diff --git a/tests/auto/qplacemanager_unsupported/tst_qplacemanager_unsupported.cpp b/tests/auto/qplacemanager_unsupported/tst_qplacemanager_unsupported.cpp
index 98a9dd31..58300904 100644
--- a/tests/auto/qplacemanager_unsupported/tst_qplacemanager_unsupported.cpp
+++ b/tests/auto/qplacemanager_unsupported/tst_qplacemanager_unsupported.cpp
@@ -120,7 +120,7 @@ void tst_QPlaceManagerUnsupported::testLocales()
 {
     QVERIFY(m_manager->locales().isEmpty());
 
-    QLocale locale(QLocale::Norwegian, QLocale::Norway);
+    QLocale locale(QLocale::NorwegianBokmal, QLocale::Norway);
     m_manager->setLocale(locale);
 
     QVERIFY(m_manager->locales().isEmpty());
-- 
2.33.0

From 861e372b6ad81570d4f496e42fb25a6699b72f2f Mon Sep 17 00:00:00 2001
From: Piotr Mikolajczyk <piotr.mikolajczyk@qt.io>
Date: Tue, 3 Nov 2020 11:43:22 +0100
Subject: [PATCH 6/6] Simpler fix to crashing Qml Map appearing 2nd+ time

Previous solution did not take advantage of the QSGNode::OwnedByParent
flag. Setting this flag to false allows to use parent() property
to determine if the node has been removed from node tree.
This amends 4fe9e0ed027134a833b2243597a2ccd00987b559

Fixes: QTBUG-85260
Change-Id: I705848483d7dc2639dffffa0ff66c682b3fffca0
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
---
 .../labs/qsg/qgeomapobjectqsgsupport.cpp      | 40 +++++--------------
 .../labs/qsg/qgeomapobjectqsgsupport_p.h      |  3 +-
 2 files changed, 11 insertions(+), 32 deletions(-)

diff --git a/src/location/labs/qsg/qgeomapobjectqsgsupport.cpp b/src/location/labs/qsg/qgeomapobjectqsgsupport.cpp
index cd180130..a978573d 100644
--- a/src/location/labs/qsg/qgeomapobjectqsgsupport.cpp
+++ b/src/location/labs/qsg/qgeomapobjectqsgsupport.cpp
@@ -48,32 +48,7 @@ static int findMapObject(QGeoMapObject *o, const QList<MapObject> &list)
     }
     return -1;
 }
-namespace  {
-bool findNodeInStructure(QSGNode *root, QSGNode *item)
-{
-    if (root == nullptr || item == nullptr)
-        return false;
-    if (root == item)
-        return true;
-    auto currentChild = root->firstChild();
-    // First check the direct child nodes and if not found let's dive deeper
-    bool bFound = (item == currentChild);
-
-    while (!bFound && currentChild) {
-        currentChild = currentChild->nextSibling();
-        bFound = (item == currentChild);
-    }
 
-    if (!bFound) {
-        currentChild = root->firstChild();
-        while (!bFound && currentChild) {
-            bFound = findNodeInStructure(currentChild, item);
-            currentChild = currentChild->nextSibling();
-        }
-    }
-    return bFound;
-}
-}
 bool QGeoMapObjectQSGSupport::createMapObjectImplementation(QGeoMapObject *obj, QGeoMapPrivate *d)
 {
     QExplicitlySharedDataPointer<QGeoMapObjectPrivate> pimpl =
@@ -182,11 +157,14 @@ void QGeoMapObjectQSGSupport::updateMapObjects(QSGNode *root, QQuickWindow *wind
 {
     if (!root)
         return;
-    if (!findNodeInStructure(root, m_mapObjectsRootNode))
-         m_mapObjectsRootNode = nullptr;
+
+    if (m_mapObjectsRootNode && m_mapObjectsRootNode->parent())
+        root->appendChildNode(m_mapObjectsRootNode.get());
+
     if (!m_mapObjectsRootNode) {
-        m_mapObjectsRootNode = new QDeclarativePolygonMapItemPrivateOpenGL::RootNode();
-        root->appendChildNode(m_mapObjectsRootNode); // PASSING OWNERSHIP!
+        m_mapObjectsRootNode = std::make_unique<QDeclarativePolygonMapItemPrivateOpenGL::RootNode>();
+        root->appendChildNode(m_mapObjectsRootNode.get());
+        m_mapObjectsRootNode->setFlag(QSGNode::OwnedByParent, false);
     }
 
     m_mapObjectsRootNode->removeAllChildNodes();
@@ -211,7 +189,7 @@ void QGeoMapObjectQSGSupport::updateMapObjects(QSGNode *root, QQuickWindow *wind
         MapObject &mo = m_mapObjects[i];
         QQSGMapObject *sgo = mo.sgObject;
         QSGNode *oldNode = mo.qsgNode;
-        mo.qsgNode = sgo->updateMapObjectNode(oldNode, &mo.visibleNode, m_mapObjectsRootNode, window);
+        mo.qsgNode = sgo->updateMapObjectNode(oldNode, &mo.visibleNode, m_mapObjectsRootNode.get(), window);
         if (Q_UNLIKELY(!mo.qsgNode)) {
             qWarning() << "updateMapObjectNode for "<<mo.object->type() << " returned NULL";
         } else if (mo.visibleNode && (mo.visibleNode->visible() != mo.object->visible())) {
@@ -227,7 +205,7 @@ void QGeoMapObjectQSGSupport::updateMapObjects(QSGNode *root, QQuickWindow *wind
         QQSGMapObject *sgo = mo.sgObject;
         QSGNode *oldNode = mo.qsgNode;
         sgo->updateGeometry(); // or subtree will be blocked
-        mo.qsgNode = sgo->updateMapObjectNode(oldNode, &mo.visibleNode, m_mapObjectsRootNode, window);
+        mo.qsgNode = sgo->updateMapObjectNode(oldNode, &mo.visibleNode, m_mapObjectsRootNode.get(), window);
         if (mo.qsgNode) {
             if (mo.visibleNode && (mo.visibleNode->visible() != mo.object->visible())) {
                 mo.visibleNode->setVisible(mo.object->visible());
diff --git a/src/location/labs/qsg/qgeomapobjectqsgsupport_p.h b/src/location/labs/qsg/qgeomapobjectqsgsupport_p.h
index 1ec966fa..cbbc0969 100644
--- a/src/location/labs/qsg/qgeomapobjectqsgsupport_p.h
+++ b/src/location/labs/qsg/qgeomapobjectqsgsupport_p.h
@@ -59,6 +59,7 @@
 #include <QtLocation/private/qdeclarativepolylinemapitem_p.h>
 #include <QtLocation/private/qdeclarativepolygonmapitem_p_p.h>
 #include <QtCore/qpointer.h>
+#include <memory>
 
 QT_BEGIN_NAMESPACE
 struct Q_LOCATION_PRIVATE_EXPORT MapObject {
@@ -85,7 +86,7 @@ public:
     QList<MapObject> m_pendingMapObjects;
     QList<MapObject> m_removedMapObjects;
     QGeoMap *m_map = nullptr;
-    QDeclarativePolygonMapItemPrivateOpenGL::RootNode *m_mapObjectsRootNode = nullptr;
+    std::unique_ptr<QDeclarativePolygonMapItemPrivateOpenGL::RootNode> m_mapObjectsRootNode;
 };
 
 QT_END_NAMESPACE
-- 
2.33.0

