Commit fc90d0f5 authored by Bernd Schmidt's avatar Bernd Schmidt
Browse files

Sync the config once after loading

Previously this could potentially call fdatasync once per puzzle, which
was pretty bad for loading times. That was exacerbated by the previous
date comparison bug that caused the config to be regenerated at every
start.
parent 9b706bf8
......@@ -140,6 +140,11 @@ Palapeli::Collection::Collection()
//make sure puzzle gets converted to archive format
puzzle->get(Palapeli::PuzzleComponent::ArchiveStorage);
}
/* Moved out of CollectionStorageComponent, where we'd potentially call fdatasync on every
puzzle. */
m_configMutex.lock();
m_config->sync();
m_configMutex.unlock();
}
Palapeli::Collection::~Collection()
......
......@@ -84,7 +84,6 @@ Palapeli::PuzzleComponent* Palapeli::CollectionStorageComponent::cast(Type type)
m_group->writeEntry("ModifyProtection", metadata.modifyProtection);
m_group->writeEntry("ModifyDateTime", mtime.toString());
m_group->writeEntry("Thumbnail", buffer.data().toBase64 ());
m_group->sync();
m_groupMutex->unlock();
return cMetadata;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment