Browse Source

【综合】KMFile类去除CDocument相关的引用

tangchao 8 months ago
parent
commit
5e66808435

+ 5 - 5
PDF Office/PDF Master/Class/KMFileManager/KMFile/KMFile.swift

@@ -20,8 +20,8 @@ class KMFile: NSObject {
     var showPath: String = ""
 //    var pdfDocument: CPDFDocument?
     var systemPDFDocument: PDFDocument?
-    var password: String = ""
-    var isLocked: Bool = false
+//    var password: String = ""
+//    var isLocked: Bool = false
     var info: KMFileInfo = KMFileInfo()
     var attributes: [FileAttributeKey : Any]?
     var image: NSImage = NSImage()
@@ -30,8 +30,8 @@ class KMFile: NSObject {
         if filePath.count != 0 {
             let attribe = try?FileManager.default.attributesOfItem(atPath: filePath)
             if attribe != nil {
-                let document = CPDFDocument.init(url: URL(fileURLWithPath: filePath))
-                document?.unlock(withPassword: self.password)
+//                let document = CPDFDocument.init(url: URL(fileURLWithPath: filePath))
+//                document?.unlock(withPassword: self.password)
                 
                 let dateFormatter: DateFormatter = DateFormatter.init()
                 let fileDate: Date = attribe![FileAttributeKey(rawValue: "NSFileModificationDate")] as! Date
@@ -84,7 +84,7 @@ class KMFile: NSObject {
                 self.image = image
                 self.info = info
 //                self.pdfDocument = document
-                self.isLocked = ((document?.isLocked) != nil)
+//                self.isLocked = ((document?.isLocked) != nil)
                 self.showPath = string.description
             }
         }

+ 0 - 4
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Extension.m

@@ -1025,10 +1025,6 @@ CGFloat DEFAULT_SNAPSHOT_HEIGHT = 200.0;
 
 @implementation CPDFView (KMExtension)
 
-//- (void)dealloc {
-//    NSLog(@"CPDFView dealloc");
-//}
-
 - (NSUndoManager *)fbUndoManager {
     @synchronized (self) {
         NSUndoManager *_fbUndoManager = objc_getAssociatedObject(self, @selector(fbUndoManager));