Commit graph

21 commits

Author SHA1 Message Date
Brad Davis
b9f9cddea0 Add versioning support to the KTX cache 2017-06-01 17:16:24 -07:00
Brad Davis
a77491ccb1 FileCache refactoring and tests 2017-05-31 13:45:59 -07:00
samcake
bdb0414add Adding a validation step at runtime for the cached KTX file in order to regenerate them if anything seems wrong 2017-05-12 18:04:22 -07:00
Ryan Huffman
d92bdbf0ed Fix unsigned/signed comparision warning 2017-05-10 09:43:55 -07:00
Ryan Huffman
6e4c5d1ab4 Update FileCache writing to check QSaveFile::write return value 2017-05-09 16:29:57 -07:00
Ryan Huffman
542001b14f Update FileCache to use QSaveFile for atomic writes 2017-05-09 14:08:43 -07:00
Ryan Huffman
d86071d783 Fix possible corruption of ktx cache files
When creating a file like this:

  1. Create file
  2. Write file
  3. Close file

there is an opening before the file is written and closed where, if the
application were to crash (or not finish for any other reason), the file
would be left in an undefined state. Instead, this change updates it to
do this:

  1. Create temp file
  2. Write temp file
  3. Close temp file
  4. Move temp file to final path

This ensures that at step 3 we have a valid file, before we rename it.
We should never end up with a final file in an undefined state, but it is
possible to end up with a temp file that is an undefined state if we,
for instance, crash during step 2.
2017-05-09 12:08:52 -07:00
Brad Davis
82d502ae9f Correctly initialize a file cache with the proper key 2017-03-24 13:35:37 -07:00
Zach Pomerantz
808973d7d2 use QStandardPaths instead of hardcoded paths 2017-03-13 17:26:42 -04:00
Zach Pomerantz
463f6454f8 use Local instead of Roaming for FileCache 2017-03-13 17:26:38 -04:00
Zach Pomerantz
172a638ef0 move resource paths to PathUtils 2017-03-13 17:26:34 -04:00
Zach Pomerantz
a0c56618b3 update FileCache to rm manifest 2017-03-13 13:41:44 -04:00
Brad Davis
43d8433d9a Removing unused include 2017-03-10 09:19:00 -08:00
Bradley Austin Davis
8a438948b9 Fix OSX link failure 2017-03-09 10:42:56 -08:00
Zach Pomerantz
6a7ee4321b suppress logs for file_cache 2017-03-02 13:30:51 -05:00
Zach Pomerantz
febeeeca3a namespace cache::FileCache and use unique_ptr 2017-03-01 20:58:00 -05:00
Zach Pomerantz
c71e614dd5 add loading from persisted files 2017-03-01 20:18:31 -05:00
Zach Pomerantz
a6a0fd3851 fix FileCache persistence 2017-03-01 11:32:11 -05:00
Zach Pomerantz
de23a11dee wip 2017-02-28 17:25:56 -05:00
Zach Pomerantz
b03f51dd26 fix double fclose 2017-02-28 16:08:54 -05:00
Zach Pomerantz
8969d7df1d FileCache 2017-02-27 17:58:48 -05:00