aboutsummaryrefslogtreecommitdiff
path: root/package/qt5/qt5location/5.11.3/0001-qdeclarativegeomap-fix-building-with-GCC-5.x.patch
blob: f893c33d503e297878c629ada8677d4bc4d291fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
From ad78b1a671edac369ede86bff376ec8af2cafbf2 Mon Sep 17 00:00:00 2001
From: Giulio Benetti <giulio.benetti@micronovasrl.com>
Date: Wed, 5 Sep 2018 12:51:41 +0200
Subject: [PATCH] qdeclarativegeomap: fix building with GCC < 5.x

With GCC < 5.x implicit casts don't work as expected, in particular
QPointer<QGeoMap> in m_map QDeclarativeGeoMap class when passed to
connect(m_map, ...) should directly cast to m_map.data().

Workaround this using connect(m_map.data(), ...).

Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
---
 src/location/declarativemaps/qdeclarativegeomap.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/location/declarativemaps/qdeclarativegeomap.cpp b/src/location/declarativemaps/qdeclarativegeomap.cpp
index 09f9d01c..dc5a32ed 100644
--- a/src/location/declarativemaps/qdeclarativegeomap.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomap.cpp
@@ -694,11 +694,11 @@ void QDeclarativeGeoMap::mappingManagerInitialized()
     QImage copyrightImage;
     if (!m_initialized && width() > 0 && height() > 0) {
         QMetaObject::Connection copyrightStringCatcherConnection =
-                connect(m_map,
+                connect(m_map.data(),
                         QOverload<const QString &>::of(&QGeoMap::copyrightsChanged),
                         [&copyrightString](const QString &copy){ copyrightString = copy; });
         QMetaObject::Connection copyrightImageCatcherConnection =
-                connect(m_map,
+                connect(m_map.data(),
                         QOverload<const QImage &>::of(&QGeoMap::copyrightsChanged),
                         [&copyrightImage](const QImage &copy){ copyrightImage = copy; });
         m_map->setViewportSize(QSize(width(), height()));
@@ -719,8 +719,8 @@ void QDeclarativeGeoMap::mappingManagerInitialized()
         emit m_map->copyrightsChanged(copyrightImage);
 
 
-    connect(m_map, &QGeoMap::sgNodeChanged, this, &QQuickItem::update);
-    connect(m_map, &QGeoMap::cameraCapabilitiesChanged, this, &QDeclarativeGeoMap::onCameraCapabilitiesChanged);
+    connect(m_map.data(), &QGeoMap::sgNodeChanged, this, &QQuickItem::update);
+    connect(m_map.data(), &QGeoMap::cameraCapabilitiesChanged, this, &QDeclarativeGeoMap::onCameraCapabilitiesChanged);
 
     // This prefetches a buffer around the map
     m_map->prefetchData();
-- 
2.17.1