Commit 2569fef5 authored by nanthony21's avatar nanthony21

Separate startJoystick from enableJoystick. Just because the joystick is not...

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
parent 328ad9ee
......@@ -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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment