summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfile.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2017-07-19 09:47:29 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2017-07-19 09:47:29 +0200
commit407302fb1b823fbe0ae09c031862f87b252489e6 (patch)
treef192faf40b9009ee6a884ed4b7d0b3942b6810ac /src/corelib/io/qfile.cpp
parent0f30dcaea8129092142fe87d2d14209c75363f66 (diff)
parentad3b41a06d9ba7219c79b5548c5b11698787288d (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: src/corelib/io/qwindowspipewriter.cpp src/widgets/styles/qcommonstyle.cpp Change-Id: I0d33efdc4dc256e234abc490a18ccda72cd1d9e6
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 c7a06e49d5..b93fea1038 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: