refs #672 setAndSave should still save even if the value is not actually changed.

This commit is contained in:
Mathew Sutcliffe
2016-06-14 23:24:16 +01:00
parent 58a04ed05c
commit b98752e84e

View File

@@ -525,9 +525,11 @@ namespace BlackMisc
Q_ASSERT(QThread::currentThread() == thread());
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(); }
else { ignoreValue = ! changed; }
auto status = validate(element, value, CStatusMessage::SeverityError);
if (status.isSuccess())