From 6b6aa978d592a4cc43518d906f0225366aae8f38 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Tue, 1 Oct 2019 18:41:16 -0700 Subject: [PATCH] Change jscript usage to make Qml compiler happy --- src/AutoPilotPlugins/APM/APMAirframeComponent.qml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/AutoPilotPlugins/APM/APMAirframeComponent.qml b/src/AutoPilotPlugins/APM/APMAirframeComponent.qml index 2f71548..9b8db30 100644 --- a/src/AutoPilotPlugins/APM/APMAirframeComponent.qml +++ b/src/AutoPilotPlugins/APM/APMAirframeComponent.qml @@ -178,8 +178,12 @@ SetupPage { property bool valid: true - function selectFrameType(frameType) { - var index = object.frameTypeEnumValues.findIndex(v => v==frameType) + function checkFrameType(value) { + return value == _frameType.rawValue + } + + function selectFrameType() { + var index = object.frameTypeEnumValues.findIndex(checkFrameType) if (index == -1 && combo.visible) { // Frame Class/Type is set to an invalid combination combo.valid = false @@ -189,12 +193,12 @@ SetupPage { } } - Component.onCompleted: selectFrameType(_frameType.rawValue) + Component.onCompleted: selectFrameType() Connections { target: _frameTypeAvailable ? _frameType : null ignoreUnknownSignals: true - onRawValueChanged: combo.selectFrameType(value) + onRawValueChanged: combo.selectFrameType() } } }