summaryrefslogtreecommitdiff
path: root/src/plugins/geoservices/mapboxgl
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2017-05-11 15:41:37 +0300
committerPaolo Angelelli <paolo.angelelli@qt.io>2017-05-20 09:29:20 +0000
commit5767601d95e33b20962d0cd88cc6ce5c8c724a91 (patch)
tree5e82ea58d1117204a4a07cd169394c38fc0af6cc /src/plugins/geoservices/mapboxgl
parent5bae353bc2faf0aab222d09b1bf21fc0e0dc37eb (diff)
downloadqtlocation-5767601d95e33b20962d0cd88cc6ce5c8c724a91.tar.gz
Fix resources not loading on static builds
Explicitly call Q_INIT_RESOURCE, otherwise the resources are not found and the plugins using resources are broken when building Qt with -static. This patch also adds a prefix to these resources to avoid collision, since they are very generic like "logo.png" or "maps.json". Task-number: QTBUG-60007 Change-Id: Ifb73e9b97af107f2e24f5478f3de534bbd40e158 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
Diffstat (limited to 'src/plugins/geoservices/mapboxgl')
-rw-r--r--src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.cpp10
-rw-r--r--src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.cpp b/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.cpp
index fb8dd19e..c7d5d3ee 100644
--- a/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.cpp
+++ b/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.cpp
@@ -40,8 +40,18 @@
#include <QtGui/QOpenGLContext>
+static void initResources()
+{
+ Q_INIT_RESOURCE(mapboxgl);
+}
+
QT_BEGIN_NAMESPACE
+QGeoServiceProviderFactoryMapboxGL::QGeoServiceProviderFactoryMapboxGL()
+{
+ initResources();
+}
+
QGeoCodingManagerEngine *QGeoServiceProviderFactoryMapboxGL::createGeocodingManagerEngine(
const QVariantMap &parameters, QGeoServiceProvider::Error *error, QString *errorString) const
{
diff --git a/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.h b/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.h
index 2bba96f1..b9c0098a 100644
--- a/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.h
+++ b/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.h
@@ -51,6 +51,8 @@ class QGeoServiceProviderFactoryMapboxGL: public QObject, public QGeoServiceProv
FILE "mapboxgl_plugin.json")
public:
+ QGeoServiceProviderFactoryMapboxGL();
+
QGeoCodingManagerEngine *createGeocodingManagerEngine(const QVariantMap &parameters,
QGeoServiceProvider::Error *error,
QString *errorString) const;