summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qsavefile.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2017-06-29 11:06:09 -0700
committerThiago Macieira <thiago.macieira@intel.com>2017-08-04 17:29:57 +0000
commit376626560237c263c79103930590eafa4d4dd8d0 (patch)
tree547122b352e4e8dc3ebb5cbbee4ef1effbdddc7e /src/corelib/io/qsavefile.cpp
parent38bc95aeceea5b4edbcfaee446d94b6062530770 (diff)
QTemporaryFile: give the engine access to the template name
Instead of storing it in d->fileEntry. The QFSFileEngine methods may try to use it before the file entry is filled with the actual file name and that's no good. This change is using a reference to avoid keeping an extra QString reference and to avoid going out of sync. Change-Id: I1eba2b016de74620bfc8fffd14cca9e340e4b1e2 Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/corelib/io/qsavefile.cpp')
-rw-r--r--src/corelib/io/qsavefile.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qsavefile.cpp b/src/corelib/io/qsavefile.cpp
index 3f45ca5f91..3f7ce8d9e9 100644
--- a/src/corelib/io/qsavefile.cpp
+++ b/src/corelib/io/qsavefile.cpp
@@ -231,7 +231,7 @@ bool QSaveFile::open(OpenMode mode)
d->finalFileName = existingFile.filePath();
}
- d->fileEngine = new QTemporaryFileEngine;
+ d->fileEngine = new QTemporaryFileEngine(&d->finalFileName);
// if the target file exists, we'll copy its permissions below,
// but until then, let's ensure the temporary file is not accessible
// to a third party