Correctly initialize a file cache with the proper key

This commit is contained in:
Brad Davis 2017-03-24 13:35:37 -07:00
parent 1972b140b9
commit 82d502ae9f

View file

@ -67,9 +67,9 @@ void FileCache::initialize() {
// load persisted files
foreach(QString filename, files) {
const Key key = filename.section('.', 0, 1).toStdString();
const Key key = filename.section('.', 0, 0).toStdString();
const std::string filepath = dir.filePath(filename).toStdString();
const size_t length = std::ifstream(filepath, std::ios::binary | std::ios::ate).tellg();
const size_t length = QFileInfo(filepath.c_str()).size();
addFile(Metadata(key, length), filepath);
}