diff --git a/src/plugins/common/core/dfmplugin-fileoperations/fileoperationsevent/trashfileeventreceiver.cpp b/src/plugins/common/core/dfmplugin-fileoperations/fileoperationsevent/trashfileeventreceiver.cpp index a9ef286568..c6234aebde 100644 --- a/src/plugins/common/core/dfmplugin-fileoperations/fileoperationsevent/trashfileeventreceiver.cpp +++ b/src/plugins/common/core/dfmplugin-fileoperations/fileoperationsevent/trashfileeventreceiver.cpp @@ -81,7 +81,14 @@ JobHandlePointer TrashFileEventReceiver::doMoveToTrash(const quint64 windowId, c && !info->isAttributes(OptInfoType::kIsSymLink) && !info->isAttributes(OptInfoType::kIsWritable); } - if (nullDirDelete || !FileUtils::fileCanTrash(sourceFirst) || !dfmio::DFMUtils::supportTrash(sourceFirst)) { + const auto &sourceInfo = InfoFactory::create(sourceFirst); + bool canTrash = false; + auto filesource = FileUtils::bindUrlTransform(sourceFirst); + if (sourceInfo) + canTrash = sourceInfo->isAttributes(OptInfoType::kIsSymLink) + && filesource.path().startsWith(StandardPaths::location(StandardPaths::StandardLocation::kHomePath)); + if (nullDirDelete || !FileUtils::fileCanTrash(sourceFirst) || + (!dfmio::DFMUtils::supportTrash(sourceFirst) && !canTrash)) { if (DialogManagerInstance->showDeleteFilesDialog(sources, true) != QDialog::Accepted) return nullptr; handle = copyMoveJob->deletes(sources, flags);