diskmanager: don't fail disk cache clear if the files simply don't exist

QFile::remove() will return false if the file doesn't exist, but
for our purposes that's as good as the file having been deleted.
This commit is contained in:
itsmattkc
2020-02-27 17:19:07 +11:00
parent a64f066e2e
commit 273522f28a
+1 -1
View File
@@ -159,7 +159,7 @@ bool DiskManager::ClearDiskCache(bool quick_delete)
const HashTime& ht = disk_data_.at(i);
// We return a false result if any of the files fail to delete, but still try to delete as many as we can
if (QFile::remove(ht.file_name)) {
if (QFile::remove(ht.file_name) || !QFileInfo::exists(ht.file_name)) {
emit DeletedFrame(ht.hash);
disk_data_.removeAt(i);
i--;