SettingsMessage: Remove existing int32 when saving an uint32

Fixes #16922 for good.

Previous attempt did read the saved value but didn't save it back properly.
This commit is contained in:
François Revol 2021-04-24 12:45:20 +02:00
parent dc31a541e0
commit c7ac2d5042

View File

@ -167,6 +167,11 @@ SettingsMessage::SetValue(const char* name, uint32 value)
status_t ret = ReplaceUInt32(name, value);
if (ret != B_OK)
ret = AddUInt32(name, value);
if (ret == B_BAD_TYPE && HasData(name, B_INT32_TYPE)) {
// For compatibility with older versions of this class, replace an int32
RemoveData(name);
ret = AddUInt32(name, value);
}
if (ret == B_OK)
_NotifyValueChanged(name);
return ret;