fix(color): new model may not load radio info and date/time widgets (#6825)
This commit is contained in:
@@ -33,7 +33,7 @@ const LayoutOption defaultLayoutOptions[] = {LAYOUT_COMMON_OPTIONS,
|
||||
|
||||
void ZonePersistentData::clear()
|
||||
{
|
||||
widgetName[0] = 0;
|
||||
widgetName.clear();
|
||||
widgetData.clear();
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ WidgetPersistentData* LayoutPersistentData::getWidgetData(int idx)
|
||||
|
||||
bool LayoutPersistentData::hasWidget(int idx)
|
||||
{
|
||||
return zones[idx].widgetName[0] != 0;
|
||||
return !zones[idx].widgetName.empty();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -280,9 +280,8 @@ void LayoutFactory::initPersistentData(int screenNum, bool setDefault) const
|
||||
// TODO compiler bug? The CPU freezes ... persistentData->options[i++]
|
||||
// = option->deflt;
|
||||
auto optVal = &layoutData->options[i];
|
||||
if (setDefault) {
|
||||
memcpy(&optVal->value, &option->deflt, sizeof(LayoutOptionValue));
|
||||
}
|
||||
if (setDefault)
|
||||
optVal->value.unsignedValue = option->deflt.unsignedValue;
|
||||
optVal->type = layoutValueEnumFromType(option->type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,8 @@ void WidgetPersistentData::setDefault(int idx, const WidgetOption* opt, bool for
|
||||
if (forced || options[idx].type != optType) {
|
||||
// reset to default value
|
||||
options[idx].type = optType;
|
||||
memcpy((void*)&options[idx].value, (void*)&opt->deflt, sizeof(WidgetOptionValue));
|
||||
options[idx].value.unsignedValue = opt->deflt.unsignedValue;
|
||||
options[idx].value.stringValue = opt->deflt.stringValue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user