From 7c9aab5e55fc1d782b9f1c759ec380c9e40da9e3 Mon Sep 17 00:00:00 2001 From: liyigang Date: Thu, 10 Oct 2024 20:09:08 +0800 Subject: [PATCH] fix: Copying a directory will cause the soft connection to point to an absolute path Read the link file's pointing path as the new link's pointing path Log: Copying a directory will cause the soft connection to point to an absolute path Bug: https://bbs.deepin.org/post/279799 --- .../fileoperationutils/fileoperatebaseworker.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 dc6b970d9f..7aadb568ae 100644 --- a/src/plugins/common/core/dfmplugin-fileoperations/fileoperations/fileoperationutils/fileoperatebaseworker.cpp +++ b/src/plugins/common/core/dfmplugin-fileoperations/fileoperations/fileoperationutils/fileoperatebaseworker.cpp @@ -516,7 +516,8 @@ bool FileOperateBaseWorker::createSystemLink(const DFileInfoPointer &fromInfo, c do { actionForlink = AbstractJobHandler::SupportAction::kNoAction; - if (localFileHandler->createSystemLink(newFromInfo->uri(), toInfo->uri())) { + auto target = QUrl::fromLocalFile(newFromInfo->attribute(DFileInfo::AttributeID::kStandardSymlinkTarget).toString()); + if (localFileHandler->createSystemLink(target, toInfo->uri())) { return true; } actionForlink = doHandleErrorAndWait(fromInfo->uri(), toInfo->uri(),