mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-27 14:29:21 +00:00
Don't need to remove the file if it doesn't exist. (This would cause a five second delay in that case.)
Fixes bug #11728. (cherry picked from commit5188f0fcff
) (cherry picked from commite60d5df4b3
)
This commit is contained in:
parent
d537d55b69
commit
194a45270c
@ -264,12 +264,14 @@ 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.
|
||||
bool removed = QFile::remove(name.d->fi.absoluteFilePath());
|
||||
int tries = 1;
|
||||
while (!removed && tries < 6) {
|
||||
QThread::sleep(1);
|
||||
removed = QFile::remove(name.d->fi.absoluteFilePath());
|
||||
tries++;
|
||||
if (name.exists()) {
|
||||
bool removed = QFile::remove(name.d->fi.absoluteFilePath());
|
||||
int tries = 1;
|
||||
while (!removed && tries < 6) {
|
||||
QThread::sleep(1);
|
||||
removed = QFile::remove(name.d->fi.absoluteFilePath());
|
||||
tries++;
|
||||
}
|
||||
}
|
||||
#else
|
||||
QFile::remove(name.d->fi.absoluteFilePath());
|
||||
|
Loading…
Reference in New Issue
Block a user