mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 02:35:33 +08:00
Prevent saving invalid values
If a value has not changed and should be saved to a file, only the key (and the invalid value) was passed to the save function. The save function does not check this case or read the value from the cache. This happens when changing simulator paths as the settings are updated and saved separately.
This commit is contained in:
committed by
Mat Sutcliffe
parent
05293feb8f
commit
d4fdc6e17b
@@ -404,7 +404,7 @@ namespace BlackMisc
|
||||
CStatusMessage setAndSave(const T &value, qint64 timestamp = 0) { return m_page->setValue(*m_element, CVariant::from(value), timestamp, true); }
|
||||
|
||||
//! Save using the currently set value. Must be called from the thread in which the owner lives.
|
||||
CStatusMessage save() { return m_page->setValue(*m_element, {}, 0, true, true); }
|
||||
CStatusMessage save() { return m_page->setValue(*m_element, {}, 0, true); }
|
||||
|
||||
//! Write a property of the value. Must be called from the thread in which the owner lives.
|
||||
CStatusMessage setProperty(CPropertyIndexRef index, const CVariant &value, qint64 timestamp = 0) { auto v = get(); v.setPropertyByIndex(index, value); return set(v, timestamp); }
|
||||
|
||||
Reference in New Issue
Block a user