Ref T367, do not read again when info/setup was just read (age)

This commit is contained in:
Klaus Basan
2018-09-22 00:25:31 +02:00
parent fd1001862f
commit 7ae7d04548
2 changed files with 22 additions and 1 deletions

View File

@@ -418,6 +418,13 @@ namespace BlackMisc
//! \threadsafe with tiny risk of mismatch of value and timestamp
QDateTime getTimestamp() const { return QDateTime::fromMSecsSinceEpoch(m_page->getTimestamp(*m_element)); }
//! Return the time when this value was updated.
//! \threadsafe with tiny risk of mismatch of value and timestamp
qint64 getTimestampMsSinceEpoch() const { return this->getTimestamp().toMSecsSinceEpoch(); }
//! How old is that cache (ms)?
qint64 lastUpdatedAge() const { return QDateTime::currentMSecsSinceEpoch() - this->getTimestampMsSinceEpoch(); }
//! Return true if this value was already saved.
bool isSaved() const { return m_page->isSaved(*m_element); }