From d807a9ebb1a09116f8bae2490253f6eb82c05c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Mon, 15 Apr 2024 17:34:51 +0200 Subject: QSaveFile[win]: remove fallback to old renameOverwrite Our new way of doing it is atomic, so while conflicts can still happen that leads to e.g. access denied, those will be because the _target file_ is already accessed for some reason. The fallback might be lucky enough that it happens after this other access is done, but probably not. So remove the fallback and just do the atomic rename. Change-Id: I13f6b4b70974500b8dd9309138b9052b6a5acc62 Reviewed-by: Thiago Macieira --- src/corelib/io/qtemporaryfile.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp index 866fa6ee8e..d76bc3b328 100644 --- a/src/corelib/io/qtemporaryfile.cpp +++ b/src/corelib/io/qtemporaryfile.cpp @@ -393,10 +393,9 @@ bool QTemporaryFileEngine::renameOverwrite(const QString &newName) } #ifdef Q_OS_WIN if (flags & Win32NonShared) { - if (d_func()->nativeRenameOverwrite(newName)) { - QFSFileEngine::close(); - return true; - } + bool ok = d_func()->nativeRenameOverwrite(newName); + QFSFileEngine::close(); + return ok; } #endif QFSFileEngine::close(); -- cgit v1.2.3