From 174b4144366a81a72dea6a77af45dca8575608cb Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Sat, 7 Oct 2017 12:08:18 +0300 Subject: 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 --- subsurface.qrc | 1 + 1 file changed, 1 insertion(+) (limited to 'subsurface.qrc') diff --git a/subsurface.qrc b/subsurface.qrc index e5f75d1e3..fc4e2ce6c 100644 --- a/subsurface.qrc +++ b/subsurface.qrc @@ -1,6 +1,7 @@ mobile-widgets/qml/MapWidget.qml + mobile-widgets/qml/MapWidgetError.qml mobile-widgets/qml/MapWidgetContextMenu.qml mobile-widgets/qml/icons/mapwidget-marker.png mobile-widgets/qml/icons/mapwidget-marker-selected.png -- cgit v1.2.3-70-g09d2