diff --git a/src/dfm-base/file/local/localfilehandler.cpp b/src/dfm-base/file/local/localfilehandler.cpp index ab49356f99..9917b3d3ae 100644 --- a/src/dfm-base/file/local/localfilehandler.cpp +++ b/src/dfm-base/file/local/localfilehandler.cpp @@ -279,6 +279,7 @@ bool LocalFileHandler::openFiles(const QList &fileUrls) for (QUrl &fileUrl : urls) { FileInfoPointer fileInfo = InfoFactory::create(fileUrl); + QUrl SourceUrl = fileUrl; QStringList targetList; targetList.append(fileUrl.path()); FileInfoPointer fileInfoLink = fileInfo; @@ -304,7 +305,8 @@ bool LocalFileHandler::openFiles(const QList &fileUrls) d->lastEvent = DialogManagerInstance->showBreakSymlinkDialog(fileInfoLink->nameOf( NameInfoType::kFileName), fileInfo->urlOf(UrlInfoType::kUrl)); - return d->lastEvent == DFMBASE_NAMESPACE::GlobalEventType::kUnknowType; + isValidPath << SourceUrl; + continue; } } diff --git a/src/dfm-base/file/local/localfilehandler.h b/src/dfm-base/file/local/localfilehandler.h index 388446dea3..034c6ecb1e 100644 --- a/src/dfm-base/file/local/localfilehandler.h +++ b/src/dfm-base/file/local/localfilehandler.h @@ -55,6 +55,7 @@ class LocalFileHandler GlobalEventType lastEventType(); QString errorString(); DFMIOErrorCode errorCode(); + QList isValidPath; private: QScopedPointer d; diff --git a/src/plugins/common/core/dfmplugin-fileoperations/fileoperationsevent/fileoperationseventreceiver.cpp b/src/plugins/common/core/dfmplugin-fileoperations/fileoperationsevent/fileoperationseventreceiver.cpp index 7756c993d4..f489f939f5 100644 --- a/src/plugins/common/core/dfmplugin-fileoperations/fileoperationsevent/fileoperationseventreceiver.cpp +++ b/src/plugins/common/core/dfmplugin-fileoperations/fileoperationsevent/fileoperationseventreceiver.cpp @@ -865,19 +865,17 @@ bool FileOperationsEventReceiver::handleOperationOpenFiles(const quint64 windowI DFMBASE_NAMESPACE::LocalFileHandler fileHandler; bool ok = fileHandler.openFiles(urls); - if (!ok) { - DFMBASE_NAMESPACE::GlobalEventType lastEvent = fileHandler.lastEventType(); - if (lastEvent != DFMBASE_NAMESPACE::GlobalEventType::kUnknowType) { - if (lastEvent == DFMBASE_NAMESPACE::GlobalEventType::kDeleteFiles) - dpfSignalDispatcher->publish(DFMBASE_NAMESPACE::GlobalEventType::kDeleteFiles, windowId, urls, AbstractJobHandler::JobFlag::kNoHint, nullptr); - else if (lastEvent == DFMBASE_NAMESPACE::GlobalEventType::kMoveToTrash) - dpfSignalDispatcher->publish(DFMBASE_NAMESPACE::GlobalEventType::kMoveToTrash, windowId, urls, AbstractJobHandler::JobFlag::kNoHint, nullptr); - } else { - // deal open file with custom dialog - dpfSlotChannel->push("dfmplugin_utils", "slot_OpenWith_ShowDialog", windowId, urls); - ok = true; + DFMBASE_NAMESPACE::GlobalEventType lastEvent = fileHandler.lastEventType(); + if (lastEvent == DFMBASE_NAMESPACE::GlobalEventType::kDeleteFiles) + dpfSignalDispatcher->publish(DFMBASE_NAMESPACE::GlobalEventType::kDeleteFiles, windowId, fileHandler.isValidPath, AbstractJobHandler::JobFlag::kNoHint, nullptr); + else if (lastEvent == DFMBASE_NAMESPACE::GlobalEventType::kMoveToTrash) + dpfSignalDispatcher->publish(DFMBASE_NAMESPACE::GlobalEventType::kMoveToTrash, windowId, fileHandler.isValidPath, AbstractJobHandler::JobFlag::kNoHint, nullptr); + else if(!ok && lastEvent == DFMBASE_NAMESPACE::GlobalEventType::kUnknowType){ + // deal open file with custom dialog + dpfSlotChannel->push("dfmplugin_utils", "slot_OpenWith_ShowDialog", windowId, fileHandler.isValidPath); + ok = true; } - } + dpfSignalDispatcher->publish(DFMBASE_NAMESPACE::GlobalEventType::kOpenFilesResult, windowId, urls, ok, error); return ok; }