Refactoring fixes
This commit is contained in:
@@ -715,6 +715,8 @@ void SetupPanel::updateStartupSwitches()
|
||||
unsigned int switchStates = model->switchWarningStates;
|
||||
|
||||
for (int i=0; i<firmware->getCapability(Switches); i++) {
|
||||
if (!IS_TARANIS(firmware->getBoard()) && i==firmware->getCapability(Switches)-1)
|
||||
continue;
|
||||
QSlider * slider = startupSwitchesSliders[i];
|
||||
QCheckBox * cb = startupSwitchesCheckboxes[i];
|
||||
bool enabled = !(model->switchWarningEnable & (1 << i));
|
||||
@@ -725,10 +727,6 @@ void SetupPanel::updateStartupSwitches()
|
||||
switchStates >>= 2;
|
||||
}
|
||||
else {
|
||||
if (i == firmware->getCapability(Switches)-1) {
|
||||
// Trainer switch, no switch warning
|
||||
continue;
|
||||
}
|
||||
slider->setValue(i==0 ? switchStates & 0x3 : switchStates & 0x1);
|
||||
switchStates >>= (i==0 ? 2 : 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user