Fix issues with saving files on network drives on Windows

In these cases the user might not have sufficient rights for
ReplaceFile to merge all file attributes and ACLs.
Make ReplaceFile ignore these errors.

Task-number: QTCREATORBUG-20560
Change-Id: I6980d8af66cb7200c39726f0e7273df83c99bf5c
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Eike Ziller
2018-06-29 12:01:08 +02:00
parent 2801372d46
commit 09a761ad7b

View File

@@ -126,7 +126,7 @@ bool SaveFile::commit()
m_tempFile.reset();
bool result = ReplaceFile(finalFileName.toStdWString().data(),
fileName().toStdWString().data(),
nullptr, 0, nullptr, nullptr);
nullptr, REPLACEFILE_IGNORE_MERGE_ERRORS, nullptr, nullptr);
if (!result) {
const DWORD replaceErrorCode = GetLastError();
QString errorStr;