summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfile.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2017-07-20 13:46:11 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2017-07-20 13:46:11 +0000
commitd39ec44e1937c354d8770c5f0257d33b13272141 (patch)
tree4a0a849c56dd6bd0c886fd83f00a57bbe9f15686 /src/corelib/io/qfile.cpp
parent32e0da45012cfe84250a8617544972f6c4c29447 (diff)
parent407302fb1b823fbe0ae09c031862f87b252489e6 (diff)
Merge "Merge remote-tracking branch 'origin/5.9' into dev" into refs/staging/dev
Diffstat (limited to 'src/corelib/io/qfile.cpp')
-rw-r--r--src/corelib/io/qfile.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index af7ff74389..2cfb718932 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -571,7 +571,9 @@ QFile::rename(const QString &newName)
// Note: this does not take file engines into account.
QByteArray targetId = QFileSystemEngine::id(QFileSystemEntry(newName));
if (!targetId.isNull()) {
- QByteArray fileId = QFileSystemEngine::id(QFileSystemEntry(d->fileName));
+ QByteArray fileId = d->fileEngine ?
+ d->fileEngine->id() :
+ QFileSystemEngine::id(QFileSystemEntry(d->fileName));
if (fileId != targetId || d->fileName.compare(newName, Qt::CaseInsensitive)) {
// ### Race condition. If a file is moved in after this, it /will/ be
// overwritten. On Unix, the proper solution is to use hardlinks: