From 16dc79fc9f392bc26cce35e2bf5574ae280ad3a5 Mon Sep 17 00:00:00 2001 From: dogmaphobic Date: Sun, 6 Dec 2015 15:16:42 -0500 Subject: [PATCH] Eliminating some QML errors when the application is shutting down. --- src/FlightMap/MapItems/VehicleMapItem.qml | 4 ++-- src/ui/toolbar/MainToolBarIndicators.qml | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/FlightMap/MapItems/VehicleMapItem.qml b/src/FlightMap/MapItems/VehicleMapItem.qml index 47c6ed1..d00f035 100644 --- a/src/FlightMap/MapItems/VehicleMapItem.qml +++ b/src/FlightMap/MapItems/VehicleMapItem.qml @@ -39,7 +39,7 @@ MapQuickItem { anchorPoint.x: vehicleIcon.width / 2 anchorPoint.y: vehicleIcon.height / 2 - visible: vehicle.coordinateValid + visible: vehicle && vehicle.coordinateValid sourceItem: Image { id: vehicleIcon @@ -51,7 +51,7 @@ MapQuickItem { transform: Rotation { origin.x: vehicleIcon.width / 2 origin.y: vehicleIcon.height / 2 - angle: vehicle.heading + angle: vehicle ? vehicle.heading : 0 } } } diff --git a/src/ui/toolbar/MainToolBarIndicators.qml b/src/ui/toolbar/MainToolBarIndicators.qml index 4653894..790e6ac 100644 --- a/src/ui/toolbar/MainToolBarIndicators.qml +++ b/src/ui/toolbar/MainToolBarIndicators.qml @@ -58,10 +58,12 @@ Row { return colorOrange; if (activeVehicle.messageTypeError) return colorRed; + // Cannot be so make make it obnoxious to show error + console.log("Invalid vehicle message type") + return "purple"; } - // Cannot be so make make it obnoxious to show error - console.log("Invalid vehicle message type") - return "purple"; + //-- It can only get here when closing (vehicle gone while window active) + return "white"; } function getBatteryVoltageText() {