From 09a761ad7b6127d992f12b8b989228df6270b8b8 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 29 Jun 2018 12:01:08 +0200 Subject: [PATCH] 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 Reviewed-by: Alessandro Portale --- src/libs/utils/savefile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/utils/savefile.cpp b/src/libs/utils/savefile.cpp index 667c3922e0d..13b9db0d849 100644 --- a/src/libs/utils/savefile.cpp +++ b/src/libs/utils/savefile.cpp @@ -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;