QFile::moveToTrash: Remove support for old MinGW SDKs
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 6a51ff3f0d
,
now remove the #ifdef'ery as well.
Change-Id: Iba44df8267f5c1e3e883368d848eb9be1bd02ac3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
This commit is contained in:
parent
6585963583
commit
63a3fd12fe
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user