|
@@ -239,36 +239,15 @@ extension KMMergeView: NSTableViewDelegate {
|
|
|
let pboard = info.draggingPasteboard
|
|
|
insertRow = row
|
|
|
|
|
|
-// NSPasteboard.PasteboardType.fileURL
|
|
|
- if pboard.availableType(from: [NSPasteboard.PasteboardType.fileURL]) != nil {
|
|
|
- let filePath = pboard.propertyList(forType: NSPasteboard.PasteboardType.fileURL) as? String
|
|
|
- let url = URL(string: filePath!)
|
|
|
- var array = [URL]()
|
|
|
- array.append(url!)
|
|
|
-// for path in fileNames {
|
|
|
-// if !isExistAtFilePath(filePath: path) {
|
|
|
-// continue
|
|
|
-// }
|
|
|
-//// if let attrib = try? FileManager.default.attributesOfItem(atPath: path),
|
|
|
-//// let fileSize = attrib[.size] as? CGFloat {
|
|
|
-////
|
|
|
-//// allFileSize += fileSize
|
|
|
-////
|
|
|
-//// if !IAPProductsManager.defaultManager.isAvailableAllFunction {
|
|
|
-//// // 免费版只支持2个文件做合并,小于20M的文件合并
|
|
|
-//// if files.count >= 2 || allFileSize > (20 * 1024 * 1024) {
|
|
|
-//// let vc = KMToolCompareWindowController.toolCompare(with: .pageEdit, setSelectIndex: 1)
|
|
|
-//// vc.showWindow(nil)
|
|
|
-////
|
|
|
-//// allFileSize -= fileSize
|
|
|
-//// addFiles(array)
|
|
|
-//// result = true
|
|
|
-//// return false
|
|
|
-//// }
|
|
|
-//// }
|
|
|
-// array.append(URL(string: path)!)
|
|
|
-//// }
|
|
|
-// }
|
|
|
+ if ((pboard.availableType(from: [NSPasteboard.PasteboardType.fileURL])) != nil) {
|
|
|
+ //获取url
|
|
|
+ var array: [URL] = []
|
|
|
+ for item: NSPasteboardItem in pboard.pasteboardItems! {
|
|
|
+ let string: String = item.string(forType: NSPasteboard.PasteboardType.fileURL)!
|
|
|
+ let url = NSURL(string: string)
|
|
|
+ array.append(url! as URL)
|
|
|
+ }
|
|
|
+
|
|
|
var theFileUrls: [URL] = []
|
|
|
for fileUrl in array {
|
|
|
if KMTools.isImageType(fileUrl.pathExtension) {
|