From 2569fef5546d75d9ba087f32d952c5edc9ad3d60 Mon Sep 17 00:00:00 2001 From: nanthony21 Date: Fri, 30 Mar 2018 20:16:25 -0500 Subject: [PATCH] Separate startJoystick from enableJoystick. Just because the joystick is not enabled doesn't mean that we don't want to be able to monitor its behavior --- src/Vehicle/Vehicle.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc index a5f2d06c4..f87d4185e 100644 --- a/src/Vehicle/Vehicle.cc +++ b/src/Vehicle/Vehicle.cc @@ -1787,6 +1787,7 @@ void Vehicle::_loadSettings(void) // Joystick enabled is a global setting so first make sure there are any joysticks connected if (_toolbox->joystickManager()->joysticks().count()) { setJoystickEnabled(settings.value(_joystickEnabledSettingsKey, false).toBool()); + _startJoystick(true); } } @@ -1839,7 +1840,6 @@ bool Vehicle::joystickEnabled(void) void Vehicle::setJoystickEnabled(bool enabled) { _joystickEnabled = enabled; - _startJoystick(_joystickEnabled); _saveSettings(); emit joystickEnabledChanged(_joystickEnabled); } @@ -1849,9 +1849,7 @@ void Vehicle::_startJoystick(bool start) Joystick* joystick = _joystickManager->activeJoystick(); if (joystick) { if (start) { - if (_joystickEnabled) { - joystick->startPolling(this); - } + joystick->startPolling(this); } else { joystick->stopPolling(); } -- 2.22.0