소스 검색

【综合】修复“多页签 重命名、show in Finder 点击无效”

wanjun 6 달 전
부모
커밋
20803c674f
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift

+ 2 - 2
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift

@@ -2385,7 +2385,7 @@ extension KMMainViewController {
             return
         }
         let tabController = sender.object as? CTTabController
-        if tabController?.title == self.document?.documentURL.lastPathComponent {
+        if tabController?.title == self.document?.documentURL.deletingPathExtension().lastPathComponent {
             if let doc = self.myDocument, doc.isDocumentEdited {
                 Task {
                     let resp = await KMAlertTool.runModel(message: NSLocalizedString("File Updated", comment: ""), buttons: [NSLocalizedString("Save", comment: ""), NSLocalizedString("Cancel", comment: "")])
@@ -2478,7 +2478,7 @@ extension KMMainViewController {
     func showInFinder(_ sender: Any) -> Void {
         if sender is NSNotification {
             let tabController = (sender as! NSNotification).object as? CTTabController
-            if tabController?.title == self.document?.documentURL.lastPathComponent {
+            if tabController?.title == self.document?.documentURL.deletingPathExtension().lastPathComponent {
                 if let file = self.myDocument?.fileURL {
                     if FileManager.default.fileExists(atPath: file.path) {
                         NSWorkspace.shared.activateFileViewerSelecting([file])