renameOverwrite: don't allow cross-partition copying
This matches the Unix behavior, and ensures atomicity (as required by QSaveFile) Change-Id: I54ec98bcd7a0714ca968cad627a5e4d684fd7af6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>bb10
parent
98e704a2da
commit
ab340e89fd
|
|
@ -522,7 +522,7 @@ bool QFSFileEngine::renameOverwrite(const QString &newName)
|
|||
Q_D(QFSFileEngine);
|
||||
bool ret = ::MoveFileEx((wchar_t*)d->fileEntry.nativeFilePath().utf16(),
|
||||
(wchar_t*)QFileSystemEntry(newName).nativeFilePath().utf16(),
|
||||
MOVEFILE_REPLACE_EXISTING | MOVEFILE_COPY_ALLOWED) != 0;
|
||||
MOVEFILE_REPLACE_EXISTING) != 0;
|
||||
if (!ret)
|
||||
setError(QFile::RenameError, QSystemError(::GetLastError(), QSystemError::NativeError).toString());
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in New Issue