Browse Source

【2025】【工具】OCR分包下载Crash修复

lizhe 1 month ago
parent
commit
c5540e3de5

+ 14 - 4
PDF Office/PDF Master/Class/KMResourceDownload/KMResourceDownloadManager.swift

@@ -157,9 +157,13 @@ class KMResourceDownloadManager: NSObject {
             if urlString.count != 0 {
                 try?FileManager.default.removeItem(atPath: kLocalFilePath)
                 
-                complete(false)
+                DispatchQueue.main.async {
+                    complete(false)
+                }
             } else {
-                complete(true)
+                DispatchQueue.main.async {
+                    complete(true)
+                }
             }
         }
     }
@@ -194,6 +198,7 @@ extension KMResourceDownloadManager {
                 if result {
                     
                 } else {
+                    
                     let alert = NSAlert()
                     alert.alertStyle = .critical
                     alert.messageText = KMLocalizedString("Need DownLoad OCR Resource", comment: "")
@@ -266,8 +271,13 @@ extension KMResourceDownloadManager: XMLParserDelegate {
 //                    <resourceURL>https://www.pdfreaderpro.com/downloads/DocumentAI.bundle.1.0.0.zip</resourceURL>
 //                </resource>
 //                <resource>
-//                    <maxVersion>4.6.3</maxVersion>
-//                    <minVersion>1.4.0</minVersion>
+//                    <maxVersion>1.4.0</maxVersion>
+//                    <minVersion>1.3.0</minVersion>
+//                    <resourceURL>https://www.pdfreaderpro.com/downloads/DocumentAI.bundle.1.2.0.zip</resourceURL>
+//                </resource>
+//                <resource>
+//                    <maxVersion>1.5.1</maxVersion>
+//                    <minVersion>1.4.1</minVersion>
 //                    <resourceURL>https://www.pdfreaderpro.com/downloads/DocumentAI.bundle.2.0.0.zip</resourceURL>
 //                </resource>
 //            </resources>

+ 2 - 2
PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideController/Views/OCR/Download/KMOCRDownloadView.xib

@@ -58,8 +58,8 @@
                             <rect key="frame" x="0.0" y="52" width="432" height="40"/>
                             <subviews>
                                 <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ZBu-Ks-gIA">
-                                    <rect key="frame" x="-2" y="12" width="112" height="16"/>
-                                    <textFieldCell key="cell" lineBreakMode="clipping" title="156.8MB / 392MB" id="Uby-IN-F4d">
+                                    <rect key="frame" x="-2" y="12" width="4" height="16"/>
+                                    <textFieldCell key="cell" lineBreakMode="clipping" id="Uby-IN-F4d">
                                         <font key="font" usesAppearanceFont="YES"/>
                                         <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
                                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>