fix(cpn): profile conversion of models and settings (#5151)

This commit is contained in:
Neil Horne
2024-06-12 10:20:49 +10:00
committed by GitHub
parent 4be97eca96
commit 199e09ed4e
6 changed files with 34 additions and 16 deletions
+2 -1
View File
@@ -206,7 +206,7 @@ RawSwitch RawSwitch::convert(RadioDataConversionState & cstate)
if (!index)
return *this;
cstate.setItemType(tr("SW"), 2);
cstate.setItemType(tr("Switch"), 2);
RadioDataConversionState::LogField oldData(index, toString(cstate.fromType, cstate.fromGS(), cstate.fromModel()));
int newIdx = 0;
@@ -223,6 +223,7 @@ RawSwitch RawSwitch::convert(RadioDataConversionState & cstate)
if (newIdx < 0 || !isAvailable(nullptr, cstate.toGS(), cstate.toType)) {
cstate.setInvalid(oldData);
clear(); // no switch is safer than an invalid one
cstate.setConverted(oldData, RadioDataConversionState::LogField(index, tr("None")));
}
return *this;