summaryrefslogtreecommitdiffstats
path: root/subsurface.qrc
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2017-10-07 12:08:18 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-10-07 08:09:05 -0700
commit174b4144366a81a72dea6a77af45dca8575608cb (patch)
treef0c9ea1db9642145567b6a8f02f296237ca82b87 /subsurface.qrc
parentd1a18b36b4227ea65ed03b65583d06363735320a (diff)
downloadsubsurface-174b4144366a81a72dea6a77af45dca8575608cb.tar.gz
map-widget: don't crash if the map QML failed to load
If the QML modules for QtLocation and QtPositioning are missing the QML in mapwidget.cpp will fail to load, which can lead to crashes. To solve the issue check if the QML has loaded and set a flag 'isReady' to true. If the loading has failed load another QML which is for showing a red error text in the lines of `MapWidget.qml failed to load!`. If the map QML has failed, use a macro in all relevant MapWidget members to turn them into a NOP. This approach leaves the rest of the codebase intact - e.g. no checks in classes which connect to the MapWidget class. Fixes #596 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'subsurface.qrc')
-rw-r--r--subsurface.qrc1
1 files changed, 1 insertions, 0 deletions
diff --git a/subsurface.qrc b/subsurface.qrc
index e5f75d1e3..fc4e2ce6c 100644
--- a/subsurface.qrc
+++ b/subsurface.qrc
@@ -1,6 +1,7 @@
<RCC>
<qresource prefix="/">
<file alias="MapWidget.qml">mobile-widgets/qml/MapWidget.qml</file>
+ <file alias="MapWidgetError.qml">mobile-widgets/qml/MapWidgetError.qml</file>
<file alias="MapWidgetContextMenu.qml">mobile-widgets/qml/MapWidgetContextMenu.qml</file>
<file alias="mapwidget-marker">mobile-widgets/qml/icons/mapwidget-marker.png</file>
<file alias="mapwidget-marker-selected">mobile-widgets/qml/icons/mapwidget-marker-selected.png</file>