|
@@ -432,15 +432,29 @@ class AutoTestAdvanceSettingView : NSView, NSTableViewDataSource, NSTableViewDel
|
|
|
}
|
|
|
|
|
|
func fileCellNeedShowInFinder(_ cell:TestFileCellView, fileName:String, type:TestFileType) {
|
|
|
+ var nFileName = NSString(string: fileName)
|
|
|
+
|
|
|
var directory = _autoTestObj?.originFileDirectory()
|
|
|
if (type == .Result) {
|
|
|
+ nFileName = NSString(string: nFileName.deletingPathExtension).appendingPathExtension(_autoTestObj?.extention() ?? "")! as NSString
|
|
|
directory = _autoTestObj?.resultFileDirectory()
|
|
|
}else if (type == .Compare) {
|
|
|
+ nFileName = NSString(string: nFileName.deletingPathExtension).appendingPathExtension(_autoTestObj?.extention() ?? "")! as NSString
|
|
|
directory = _autoTestObj?.checkFileDirectory()
|
|
|
}
|
|
|
|
|
|
- var path = NSString(string: directory!).appendingPathComponent(fileName);
|
|
|
- NSWorkspace.shared.activateFileViewerSelecting([URL(fileURLWithPath: path)])
|
|
|
+ var path = NSString(string: directory!).appendingPathComponent(nFileName as String);
|
|
|
+ if (FileManager.default.fileExists(atPath: path)) {
|
|
|
+ NSWorkspace.shared.activateFileViewerSelecting([URL(fileURLWithPath: path)])
|
|
|
+ }else {
|
|
|
+ path = NSString(string: path).deletingPathExtension.appending(".jpg")
|
|
|
+
|
|
|
+ if (FileManager.default.fileExists(atPath: path)) {
|
|
|
+ NSWorkspace.shared.activateFileViewerSelecting([URL(fileURLWithPath: path)])
|
|
|
+ }else {
|
|
|
+ NSWorkspace.shared.activateFileViewerSelecting([URL(fileURLWithPath: NSString(string: path).deletingLastPathComponent)])
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
func fileCellNeedDelete(_ cell:TestFileCellView, fileName:String) {
|