mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Don't need to remove the file if it doesn't exist. (This would cause a five second delay in that case.)
(cherry picked from commit 5188f0fcff
)
This commit is contained in:
parent
b0a2868938
commit
e60d5df4b3
@ -264,12 +264,14 @@ bool FileName::moveTo(FileName const & name) const
|
|||||||
// there's a locking problem on Windows sometimes, so
|
// there's a locking problem on Windows sometimes, so
|
||||||
// we will keep trying for five seconds, in the hope
|
// we will keep trying for five seconds, in the hope
|
||||||
// that clears.
|
// that clears.
|
||||||
bool removed = QFile::remove(name.d->fi.absoluteFilePath());
|
if (name.exists()) {
|
||||||
int tries = 1;
|
bool removed = QFile::remove(name.d->fi.absoluteFilePath());
|
||||||
while (!removed && tries < 6) {
|
int tries = 1;
|
||||||
QThread::sleep(1);
|
while (!removed && tries < 6) {
|
||||||
removed = QFile::remove(name.d->fi.absoluteFilePath());
|
QThread::sleep(1);
|
||||||
tries++;
|
removed = QFile::remove(name.d->fi.absoluteFilePath());
|
||||||
|
tries++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
QFile::remove(name.d->fi.absoluteFilePath());
|
QFile::remove(name.d->fi.absoluteFilePath());
|
||||||
|
Loading…
Reference in New Issue
Block a user