refs #494 Using CValueCachePacket, cache values are given timestamps.

This commit is contained in:
Mathew Sutcliffe
2015-10-22 22:37:45 +01:00
parent eb11b69c6d
commit 966eed9044
13 changed files with 99 additions and 64 deletions

View File

@@ -26,7 +26,7 @@ namespace BlackCore
CLogMessage(this).error("Failed to create directory %1") << persistentStore();
}
connect(this, &CValueCache::valuesChangedByLocal, this, &CDataCache::saveToStore);
connect(this, &CValueCache::valuesChangedByLocal, this, [this](const CValueCachePacket &values) { saveToStore(values.toVariantMap()); });
connect(&m_watcher, &QFileSystemWatcher::fileChanged, this, [this] { loadFromStore(); });
if (! QFile::exists(m_revisionFileName)) { QFile(m_revisionFileName).open(QFile::WriteOnly); }
@@ -116,7 +116,7 @@ namespace BlackCore
if (m_revision != newRevision)
{
m_revision = newRevision;
CVariantMap newValues;
CValueCachePacket newValues;
loadFromFiles(persistentStore(), newValues);
m_deferredChanges.insert(newValues);
}