Просмотр исходного кода

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

wanjun 6 месяцев назад
Родитель
Сommit
20803c674f

+ 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])