(self, table, row, column)
| 1432 | return ("其他", "-", line) |
| 1433 | |
| 1434 | def open_preview_path(self, table, row, column): |
| 1435 | if column != 2: |
| 1436 | return |
| 1437 | item = table.item(row, column) |
| 1438 | if not item: |
| 1439 | return |
| 1440 | target_path = item.data(Qt.UserRole) or item.text() |
| 1441 | if not target_path: |
| 1442 | return |
| 1443 | try: |
| 1444 | if os.path.exists(target_path): |
| 1445 | os.startfile(target_path) |
| 1446 | else: |
| 1447 | parent_path = os.path.dirname(target_path) |
| 1448 | if parent_path and os.path.isdir(parent_path): |
| 1449 | os.startfile(parent_path) |
| 1450 | else: |
| 1451 | self.setWarninginfo("文件不存在,可能已经被移动或删除。") |
| 1452 | except OSError as e: |
| 1453 | self.setWarninginfo(f"打开失败:{e}") |
| 1454 | |
| 1455 | def show_preview_dialog(self, total_stats, detail_lines): |
| 1456 | # 清理前预览,不再一点开始就直接进回收站。 |
no test coverage detected