diff --git a/src/plugins/common/core/dfmplugin-fileoperations/fileoperations/fileoperationutils/fileoperatebaseworker.cpp b/src/plugins/common/core/dfmplugin-fileoperations/fileoperations/fileoperationutils/fileoperatebaseworker.cpp index 2bbf9cb3f6..3e592edf5d 100644 --- a/src/plugins/common/core/dfmplugin-fileoperations/fileoperations/fileoperationutils/fileoperatebaseworker.cpp +++ b/src/plugins/common/core/dfmplugin-fileoperations/fileoperations/fileoperationutils/fileoperatebaseworker.cpp @@ -786,7 +786,6 @@ void FileOperateBaseWorker::initCopyWay() QUrl FileOperateBaseWorker::trashInfo(const DFileInfoPointer &fromInfo) { - auto parentPath = parentUrl(fromInfo->uri()).path(); if (!parentPath.endsWith("files")) return QUrl(); diff --git a/src/plugins/common/core/dfmplugin-fileoperations/fileoperations/trashfiles/dorestoretrashfilesworker.cpp b/src/plugins/common/core/dfmplugin-fileoperations/fileoperations/trashfiles/dorestoretrashfilesworker.cpp index 1f5b4b7355..2918d5f4fb 100644 --- a/src/plugins/common/core/dfmplugin-fileoperations/fileoperations/trashfiles/dorestoretrashfilesworker.cpp +++ b/src/plugins/common/core/dfmplugin-fileoperations/fileoperations/trashfiles/dorestoretrashfilesworker.cpp @@ -173,8 +173,11 @@ bool DoRestoreTrashFilesWorker::doRestoreTrashFiles() } } DFileInfoPointer fileInfo { new DFileInfo(url) }; + // read trash info QUrl trashInfoUrl { fileInfo->attribute(DFileInfo::AttributeID::kStandardTargetUri).toString().replace("/files/", "/info/") + ".trashinfo" }; + QUrl trashUrl = QUrl(fileInfo->attribute(DFileInfo::AttributeID::kStandardTargetUri).toString()); + fileInfo.reset(new DFileInfo(trashUrl)); const QString &trashInfoCache { DFMIO::DFile(trashInfoUrl).readAll() }; emitCurrentTaskNotify(url, restoreInfo->uri()); bool ok = false;