File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -54,11 +54,11 @@ def openfile(self):
5454
5555
5656 def double_click_search_table (self , info ):
57- file_path = self .resultTable .item (info .row (), 0 ).text ()
58- try :
57+ file_path = os . path . normpath ( self .resultTable .item (info .row (), 0 ).text () )
58+ if os . path . exists ( file_path ) :
5959 os .startfile (file_path )
60- except Exception :
61- QtWidgets .QMessageBox .warning (self , '警告' , '打开文件失败 :' + file_path )
60+ else :
61+ QtWidgets .QMessageBox .warning (self , '警告' , '图片文件不存在 :' + file_path )
6262
6363
6464 def double_click_duplicate_table (self , info ):
@@ -67,10 +67,10 @@ def double_click_duplicate_table(self, info):
6767 return
6868 row = info .row ()
6969 file_path = self .resultTableDuplicate .item (row , col ).text ()
70- try :
70+ if os . path . exists ( file_path ) :
7171 os .startfile (file_path )
72- except Exception :
73- QtWidgets .QMessageBox .warning (self , '警告' , '打开文件失败 :' + file_path )
72+ else :
73+ QtWidgets .QMessageBox .warning (self , '警告' , '图片文件不存在 :' + file_path )
7474
7575
7676 def start_search (self ):
You can’t perform that action at this time.
0 commit comments