Make qtbase compile with QT_NO_TEMPORARYFILE

Change-Id: I0211ed44513723392e3f50b76be10b95c0bcddd5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
bb10
Tasuku Suzuki 2013-06-28 01:57:10 +09:00 committed by The Qt Project
parent f568e43e10
commit 67cf8bf9a8
1 changed files with 4 additions and 1 deletions

View File

@ -571,6 +571,8 @@ QFile::rename(const QString &newName)
d->setError(QFile::RenameError, tr("Destination file exists"));
return false;
}
#ifndef QT_NO_TEMPORARYFILE
// This #ifndef disables the workaround it encloses. Therefore, this configuration is not recommended.
#ifdef Q_OS_LINUX
// rename() on Linux simply does nothing when renaming "foo" to "Foo" on a case-insensitive
// FS, such as FAT32. Move the file away and rename in 2 steps to work around.
@ -598,7 +600,8 @@ QFile::rename(const QString &newName)
arg(QDir::toNativeSeparators(tempFile.fileName()), tempFile.errorString()));
}
return false;
#endif
#endif // Q_OS_LINUX
#endif // QT_NO_TEMPORARYFILE
}
unsetError();
close();