mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 15:25:35 +08:00
refs #536 Moved CDataCache serialization into a worker thread.
This commit is contained in:
@@ -249,19 +249,17 @@ namespace BlackMisc
|
||||
{
|
||||
QMutexLocker lock(&m_mutex);
|
||||
CValueCachePacket values;
|
||||
auto status = loadFromFiles(dir, values);
|
||||
auto status = loadFromFiles(dir, getAllValues(), values);
|
||||
insertValues(values);
|
||||
return status;
|
||||
}
|
||||
|
||||
CStatusMessage CValueCache::loadFromFiles(const QString &dir, CValueCachePacket &o_values) const
|
||||
CStatusMessage CValueCache::loadFromFiles(const QString &dir, const CVariantMap ¤tValues, CValueCachePacket &o_values) const
|
||||
{
|
||||
QMutexLocker lock(&m_mutex);
|
||||
if (! QDir(dir).isReadable())
|
||||
{
|
||||
return CLogMessage(this).error("Failed to read directory %1") << dir;
|
||||
}
|
||||
auto currentValues = getAllValues();
|
||||
for (const auto &filename : QDir(dir).entryList({ "*.json" }, QDir::Files))
|
||||
{
|
||||
QFile file(dir + "/" + filename);
|
||||
|
||||
Reference in New Issue
Block a user