diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index 355d553aaf0..4a5860d0b1b 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -1178,13 +1178,22 @@ bool QFileSystemEngine::createLink(const QFileSystemEntry &source, const QFileSy return false; } -#ifndef Q_OS_DARWIN +#ifdef Q_OS_DARWIN +// see qfilesystemengine_mac.mm +#elif defined(QT_BOOTSTRAPPED) +// bootstrapped tools don't need this, and we don't want QStorageInfo +//static +bool QFileSystemEngine::moveFileToTrash(const QFileSystemEntry &, QFileSystemEntry &, + QSystemError &error) +{ + error = QSystemError(ENOSYS, QSystemError::StandardLibraryError); + return false; +} +#else /* Implementing as per https://specifications.freedesktop.org/trash-spec/trashspec-1.0.html */ -// bootstrapped tools don't need this, and we don't want QStorageInfo -#ifndef QT_BOOTSTRAPPED static QString freeDesktopTrashLocation(const QString &sourcePath) { auto makeTrashDir = [](const QDir &topDir, const QString &trashDir = QString()) { @@ -1279,18 +1288,11 @@ static QString freeDesktopTrashLocation(const QString &sourcePath) return trash; } -#endif // QT_BOOTSTRAPPED //static bool QFileSystemEngine::moveFileToTrash(const QFileSystemEntry &source, QFileSystemEntry &newLocation, QSystemError &error) { -#ifdef QT_BOOTSTRAPPED - Q_UNUSED(source); - Q_UNUSED(newLocation); - error = QSystemError(ENOSYS, QSystemError::StandardLibraryError); - return false; -#else const QFileInfo sourceInfo(source.filePath()); if (!sourceInfo.exists()) { error = QSystemError(ENOENT, QSystemError::StandardLibraryError); @@ -1386,9 +1388,8 @@ bool QFileSystemEngine::moveFileToTrash(const QFileSystemEntry &source, newLocation = std::move(target); return true; -#endif // QT_BOOTSTRAPPED } -#endif // Q_OS_DARWIN +#endif // !Q_OS_DARWIN && !QT_BOOTSTRAPPED //static bool QFileSystemEngine::copyFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)