From 5b4407a0c9f4d8da17b76aa3ff05a68e2ce59ad3 Mon Sep 17 00:00:00 2001 From: Gus Grubba Date: Sat, 27 Apr 2019 12:52:28 -0400 Subject: [PATCH] Avoid variable name colision --- src/FlightDisplay/MultiVehicleList.qml | 2 +- src/QmlControls/FlightModeMenu.qml | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/FlightDisplay/MultiVehicleList.qml b/src/FlightDisplay/MultiVehicleList.qml index 64ffdc12e..cdb1b5cdf 100644 --- a/src/FlightDisplay/MultiVehicleList.qml +++ b/src/FlightDisplay/MultiVehicleList.qml @@ -123,7 +123,7 @@ Item { Layout.alignment: Qt.AlignHCenter font.pointSize: ScreenTools.largeFontPointSize color: _textColor - activeVehicle: _vehicle + currentVehicle: _vehicle } QGCLabel { diff --git a/src/QmlControls/FlightModeMenu.qml b/src/QmlControls/FlightModeMenu.qml index c46df0aca..f66ba5175 100644 --- a/src/QmlControls/FlightModeMenu.qml +++ b/src/QmlControls/FlightModeMenu.qml @@ -17,9 +17,9 @@ import QGroundControl.ScreenTools 1.0 // Label control whichs pop up a flight mode change menu when clicked QGCLabel { id: flightModeMenuLabel - text: activeVehicle ? activeVehicle.flightMode : qsTr("N/A", "No data to display") + text: currentVehicle ? currentVehicle.flightMode : qsTr("N/A", "No data to display") - property var activeVehicle: QGroundControl.multiVehicleManager.activeVehicle + property var currentVehicle: QGroundControl.multiVehicleManager.activeVehicle Menu { id: flightModesMenu @@ -29,14 +29,14 @@ QGCLabel { id: flightModeMenuItemComponent MenuItem { - onTriggered: activeVehicle.flightMode = text + onTriggered: currentVehicle.flightMode = text } } property var flightModesMenuItems: [] function updateFlightModesMenu() { - if (activeVehicle && activeVehicle.flightModeSetAvailable) { + if (currentVehicle && currentVehicle.flightModeSetAvailable) { var i; // Remove old menu items for (i = 0; i < flightModesMenuItems.length; i++) { @@ -44,8 +44,8 @@ QGCLabel { } flightModesMenuItems.length = 0 // Add new items - for (i = 0; i < activeVehicle.flightModes.length; i++) { - var menuItem = flightModeMenuItemComponent.createObject(null, { "text": activeVehicle.flightModes[i] }) + for (i = 0; i < currentVehicle.flightModes.length; i++) { + var menuItem = flightModeMenuItemComponent.createObject(null, { "text": currentVehicle.flightModes[i] }) flightModesMenuItems.push(menuItem) flightModesMenu.insertItem(i, menuItem) } @@ -60,7 +60,7 @@ QGCLabel { } MouseArea { - visible: activeVehicle && activeVehicle.flightModeSetAvailable + visible: currentVehicle && currentVehicle.flightModeSetAvailable anchors.fill: parent onClicked: flightModesMenu.popup() } -- 2.22.0