mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-18 19:35:33 +08:00
refs #672 setAndSave should still save even if the value is not actually changed.
This commit is contained in:
@@ -525,9 +525,11 @@ namespace BlackMisc
|
|||||||
Q_ASSERT(QThread::currentThread() == thread());
|
Q_ASSERT(QThread::currentThread() == thread());
|
||||||
|
|
||||||
if (timestamp == 0) { timestamp = QDateTime::currentMSecsSinceEpoch(); }
|
if (timestamp == 0) { timestamp = QDateTime::currentMSecsSinceEpoch(); }
|
||||||
if (element.m_value.read() == value && element.m_timestamp == timestamp && ! ignoreValue) { return {}; }
|
bool changed = element.m_value.read() != value || element.m_timestamp != timestamp;
|
||||||
|
if (! changed && ! save && ! ignoreValue) { return {}; }
|
||||||
|
|
||||||
if (ignoreValue) { value = element.m_value.read(); }
|
if (ignoreValue) { value = element.m_value.read(); }
|
||||||
|
else { ignoreValue = ! changed; }
|
||||||
|
|
||||||
auto status = validate(element, value, CStatusMessage::SeverityError);
|
auto status = validate(element, value, CStatusMessage::SeverityError);
|
||||||
if (status.isSuccess())
|
if (status.isSuccess())
|
||||||
|
|||||||
Reference in New Issue
Block a user