From 63a3fd12fe166a8eabc6c13dc9da4901bc1287ce Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 9 Mar 2022 11:23:54 +0100 Subject: [PATCH] QFile::moveToTrash: Remove support for old MinGW SDKs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SDK headers that shipped with older versions of MinGW didn't declare the IFileOperation COM interface, so the original implementation of moveToTrash included an inferior fallback that used the Shell APIs. That fallback was already removed in 6a51ff3f0d6ca6b268825b60c95ddcf972bb4d49, now remove the #ifdef'ery as well. Change-Id: Iba44df8267f5c1e3e883368d848eb9be1bd02ac3 Reviewed-by: Qt CI Bot Reviewed-by: Thiago Macieira Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Ievgenii Meshcheriakov --- src/corelib/io/qfilesystemengine_win.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp index eeec5236e2..3da6c06a8d 100644 --- a/src/corelib/io/qfilesystemengine_win.cpp +++ b/src/corelib/io/qfilesystemengine_win.cpp @@ -779,7 +779,6 @@ static inline bool getFindData(QString path, WIN32_FIND_DATA &findData) return false; } -#if defined(__IFileOperation_INTERFACE_DEFINED__) class FileOperationProgressSink : public IFileOperationProgressSink { public: @@ -866,7 +865,6 @@ public: private: ULONG ref; }; -#endif bool QFileSystemEngine::uncListSharesOnServer(const QString &server, QStringList *list) { @@ -1808,7 +1806,6 @@ bool QFileSystemEngine::moveFileToTrash(const QFileSystemEntry &source, // we need the "display name" of the file, so can't use nativeAbsoluteFilePath const QString sourcePath = QDir::toNativeSeparators(absoluteName(source).filePath()); -# if defined(__IFileOperation_INTERFACE_DEFINED__) CoInitialize(nullptr); IFileOperation *pfo = nullptr; IShellItem *deleteItem = nullptr; @@ -1845,9 +1842,7 @@ bool QFileSystemEngine::moveFileToTrash(const QFileSystemEntry &source, return false; newLocation = QFileSystemEntry(sink->targetPath); -# endif // no IFileOperation in SDK (mingw, likely) - fall back to SHFileOperation return true; - } //static