Przeglądaj źródła

【导航栏】文件-从剪贴板创建失败

liujiajie 10 miesięcy temu
rodzic
commit
60071478a5

+ 2 - 2
PDF Office/PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift

@@ -1686,7 +1686,7 @@ extension KMBrowserWindowController: KMSystemViewMenuProtocol {
             return path
         } else {
             let originalFullFileName = path.lastPathComponent
-            let originalFileName = path.lastPathComponent.deletingPathExtension
+            let originalFileName = path.lastPathComponent.deletingPathExtension.lastPathComponent
             let originalExtension = path.extension
 
             let startIndex: Int = 0
@@ -1695,7 +1695,7 @@ extension KMBrowserWindowController: KMSystemViewMenuProtocol {
             var i = 1
             while (1 != 0) {
                 var newName = String(format: "%@%ld", originalFileName, i)
-                newName = newName.stringByAppendingPathExtension(originalExtension)
+                newName = String(format: "%@%@", newName, originalExtension)
                 let newPath = fileLocatePath.stringByAppendingPathComponent(newName)
                 if !dManager.fileExists(atPath: newPath) {
                     return newPath

+ 2 - 2
PDF Office/PDF Master/Class/Document/KMDocumentController.swift

@@ -34,7 +34,7 @@ class KMDocumentController: NSDocumentController {
             return path
         } else {
             let originalFullFileName = path.lastPathComponent
-            let originalFileName = path.lastPathComponent.deletingPathExtension
+            let originalFileName = path.lastPathComponent.deletingPathExtension.lastPathComponent
             let originalExtension = path.extension
 
             let startIndex: Int = 0
@@ -43,7 +43,7 @@ class KMDocumentController: NSDocumentController {
             var i = 1
             while (1 != 0) {
                 var newName = String(format: "%@%ld", originalFileName, i)
-                newName = newName.stringByAppendingPathExtension(originalExtension)
+                newName = String(format: "%@%@", newName, originalExtension)
                 let newPath = fileLocatePath.stringByAppendingPathComponent(newName)
                 if !dManager.fileExists(atPath: newPath) {
                     return newPath