From 82d502ae9f494f07c573d4798ac6a2fb50b82638 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Fri, 24 Mar 2017 13:35:37 -0700 Subject: [PATCH] Correctly initialize a file cache with the proper key --- libraries/networking/src/FileCache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/networking/src/FileCache.cpp b/libraries/networking/src/FileCache.cpp index f8a86903cb..0a859d511b 100644 --- a/libraries/networking/src/FileCache.cpp +++ b/libraries/networking/src/FileCache.cpp @@ -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); }