From 527d4c487ff5f6229272f121ebef90d8ffd4d982 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Fri, 1 Jul 2016 10:35:52 -0700 Subject: [PATCH] Fix button code --- src/Joystick/Joystick.cc | 6 +++--- src/VehicleSetup/JoystickConfig.qml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Joystick/Joystick.cc b/src/Joystick/Joystick.cc index 863866b60..725019b02 100644 --- a/src/Joystick/Joystick.cc +++ b/src/Joystick/Joystick.cc @@ -122,7 +122,7 @@ void Joystick::_loadSettings(void) qCDebug(JoystickLog) << "_loadSettings function:axis:badsettings" << function << functionAxis << badSettings; } - for (int button=0; button<_buttonCount; button++) { + for (int button=0; button<_totalButtonCount; button++) { _rgButtonActions << settings.value(QString(_buttonActionSettingsKey).arg(button), QString()).toString(); qCDebug(JoystickLog) << "_loadSettings button:action" << button << _rgButtonActions[button]; } @@ -172,7 +172,7 @@ void Joystick::_saveSettings(void) qCDebug(JoystickLog) << "_saveSettings name:function:axis" << _name << function << _rgFunctionSettingsKey[function]; } - for (int button=0; button<_buttonCount; button++) { + for (int button=0; button<_totalButtonCount; button++) { settings.setValue(QString(_buttonActionSettingsKey).arg(button), _rgButtonActions[button]); qCDebug(JoystickLog) << "_saveSettings button:action" << button << _rgButtonActions[button]; } @@ -471,7 +471,7 @@ QVariantList Joystick::buttonActions(void) { QVariantList list; - for (int button=0; button<_buttonCount; button++) { + for (int button=0; button<_totalButtonCount; button++) { list += QVariant::fromValue(_rgButtonActions[button]); } diff --git a/src/VehicleSetup/JoystickConfig.qml b/src/VehicleSetup/JoystickConfig.qml index 23f6ec68b..79f8ce119 100644 --- a/src/VehicleSetup/JoystickConfig.qml +++ b/src/VehicleSetup/JoystickConfig.qml @@ -465,7 +465,7 @@ QGCView { Repeater { id: buttonActionRepeater - model: _activeJoystick.buttonCount + model: _activeJoystick.totalButtonCount Row { spacing: ScreenTools.defaultFontPixelWidth -- 2.22.0