diff --git a/src/Joystick/Joystick.cc b/src/Joystick/Joystick.cc index 863866b6004d31654a3ef8915526998feae83041..725019b026ab493a4c25dc2b0d398af3d56395de 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 23f6ec68bcd390f6443c85bc3b17ddddcb85c2b4..79f8ce119274e265176373fbaa310eeb7fcb0f09 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