Repository navigation
fix: prompt wrong password on single file extract - #488
deepin-bot[bot] merged 1 commit into
Conversation
1. Root cause: handleJobErrorFinished() single-extract branch switch only handled ET_LongNameError and ET_MissingVolume, ET_WrongPassword fell into default:break and was silently swallowed 2. Fix: add ET_WrongPassword case to show floating message, matching the disabled #if 0 block and JT_Add branch behavior 3. Impact: only affects encrypted archive single-file extract with wrong password, no change to other error paths or operations Log: Show wrong password prompt on encrypted archive single file extract Influence: 1. Test single file extract from encrypted archive with wrong password 2. Test single file extract from encrypted archive with correct password 3. Test batch extract from encrypted archive with wrong password fix: 修复加密压缩包单文件提取时密码错误无提示 1. 根因:handleJobErrorFinished() 单文件提取分支的 switch 仅处理 ET_LongNameError 和 ET_MissingVolume,ET_WrongPassword 落入 default:break 被静默吞掉 2. 方案:在 switch 中新增 ET_WrongPassword case,弹出浮层提示, 与被 #if 0 禁用的逻辑及 JT_Add 分支处理方式一致 3. 影响:仅影响加密压缩包单文件提取输入错误密码的场景,不影响 其他错误类型和其他操作路径 Log: 加密压缩包右键单文件提取输入错误密码时提示密码错误 Influence: 1. 测试加密压缩包右键单个文件提取输入错误密码 2. 测试加密压缩包右键单个文件提取输入正确密码 3. 测试加密压缩包批量解压输入错误密码 PMS: BUG-376693
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds explicit ET_WrongPassword handling to the single-file extraction error path so encrypted archives with an incorrect password display a floating “Wrong password” message instead of silently ignoring the error; other error paths and extraction modes remain unchanged. Sequence diagram for single-file extraction wrong-password handlingsequenceDiagram
participant User
participant MainWindow
participant CustomFloatingMessage
User->>MainWindow: Extract single file
MainWindow->>MainWindow: handleJobErrorFinished(JT_Add, ET_WrongPassword)
MainWindow->>CustomFloatingMessage: CustomFloatingMessage(icon, Wrong password, 1000, this)
MainWindow->>CustomFloatingMessage: sendMessage(...)
CustomFloatingMessage-->>User: Display Wrong password
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
/merge |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: LiHua000, max-lvs The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
This pr cannot be merged! (status: unstable) |
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 语法正确,逻辑清晰。新增的 case ET_WrongPassword 分支语法正确,break 语句完整,花括号包裹规范。icon 变量在 switch 之前已初始化(第1760行),this 指针有效,无空指针风险。CustomFloatingMessage 通过 new 创建并传入 this 作为 parent,由 Qt 父子机制管理生命周期,无内存泄漏。逻辑正确:将原本落入 default:break 被静默吞掉的 ET_WrongPassword 错误改为弹出浮层提示,与 JT_Add 分支(第1707-1709行)处理方式一致。 2. 代码质量 ✅评价: 优秀 ✅ 通过 潜在问题:
建议: 建议在新增的 case ET_WrongPassword 上方添加 // 密码错误 注释,与 JT_Add 分支保持一致。其余代码结构清晰,遵循现有模式,无重复代码引入。 3. 代码性能 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 性能良好,资源使用合理。新增代码仅调用 sendMessage 显示浮层提示,无性能开销。CustomFloatingMessage 由 Qt 父子机制管理,无资源泄漏风险。 4. 代码安全 🔒评价: 优秀 ✅ 通过
安全漏洞详情: 建议: 存在0个安全漏洞。tr("Wrong password") 为静态可翻译字符串,无注入风险。无用户输入直接用于危险操作,无敏感信息泄露。 💡 改进建议代码示例// 建议在 case 上方添加注释,与 JT_Add 分支保持一致
// 密码错误
case ET_WrongPassword: {
sendMessage(new CustomFloatingMessage(icon, tr("Wrong password"), 1000, this));
break;
}本报告由 AI 代码审查工具自动生成 |
|
/merge |
Log: Show wrong password prompt on encrypted archive single file extract
Influence:
fix: 修复加密压缩包单文件提取时密码错误无提示
Log: 加密压缩包右键单文件提取输入错误密码时提示密码错误
Influence:
PMS: BUG-376693
Summary by Sourcery
Bug Fixes: