(self, v)
| 1630 | return dialog.exec_() == QDialog.Accepted |
| 1631 | |
| 1632 | def callback(self, v): |
| 1633 | self.bar_progress.setRange(0, 100) |
| 1634 | total = int((self.total_file + self.total_dir)) |
| 1635 | if total <= 0: |
| 1636 | self.bar_progress.setValue(0) |
| 1637 | return |
| 1638 | value = v / total * 100 |
| 1639 | self.bar_progress.setValue(int(value)) |
| 1640 | if value >= 100: |
| 1641 | direct_delete = self.config.get("global", {}).get("direct_delete", False) |
| 1642 | final_tip = "文件已直接删除。" if direct_delete else "请前往回收站检查并清空。" |
| 1643 | out = "本次共清理文件" + str(self.total_file) + "个,文件夹" + str( |
| 1644 | self.total_dir) + "个,预计释放空间" + format_size(getattr(self, 'total_size', 0)) + "。\n" + final_tip |
| 1645 | self.setSuccessinfo(out) |
| 1646 | self.thread_list = [] |
| 1647 | if getattr(self, "auto_clean_running", False): |
| 1648 | state = load_json(STATE_PATH, {}) |
| 1649 | state["last_auto_clean"] = datetime.datetime.now().strftime("%Y-%m-%d") |
| 1650 | save_json(STATE_PATH, state) |
| 1651 | self.auto_clean_running = False |
| 1652 | return |
| 1653 | |
| 1654 | def should_run_auto_clean(self, config): |
| 1655 | global_config = config.get("global", {}) |
nothing calls this directly
no test coverage detected