Refactoring fixes

This commit is contained in:
bsongis
2014-12-17 20:13:25 +01:00
parent 567dcd74f0
commit 5046f77cd9
5 changed files with 61 additions and 60 deletions
+2 -4
View File
@@ -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);
}