Don't need to remove the file if it doesn't exist. (This would cause a five second delay in that case.)

This commit is contained in:
Richard Kimberly Heck 2020-02-03 11:37:12 -05:00
parent 05f2494008
commit 5188f0fcff

View File

@ -272,6 +272,7 @@ bool FileName::moveTo(FileName const & name) const
// there's a locking problem on Windows sometimes, so
// we will keep trying for five seconds, in the hope
// that clears.
if (name.exists()) {
bool removed = QFile::remove(name.d->fi.absoluteFilePath());
int tries = 1;
while (!removed && tries < 6) {
@ -279,6 +280,7 @@ bool FileName::moveTo(FileName const & name) const
removed = QFile::remove(name.d->fi.absoluteFilePath());
tries++;
}
}
#else
QFile::remove(name.d->fi.absoluteFilePath());
#endif