From f19eb2e47d399028f9af2787206ede2cd89b77f8 Mon Sep 17 00:00:00 2001 From: zhangtingan Date: Mon, 14 Sep 2026 15:59:03 +0800 Subject: [PATCH] fix: match new 7-Zip "Cannot" output for missing volume MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Root cause: readListLine() hardcoded "Can not" (two words) from old p7zip; new 7-Zip 26.02 outputs "Cannot" (one word), so the check failed and the corrupt-archive dialog appeared instead of a direct error 2. Fix: add a parallel startsWith branch for "Cannot" while keeping the original "Can not" match, so both old p7zip and new 7-Zip are handled 3. Impact: only the missing-volume error detection in readListLine() changes; existing behavior for old p7zip is preserved Log: fix missing-volume detection to support new 7-Zip 26.02 output Influence: 1. Test opening a 7z split archive with a missing volume using new 7-Zip 26.02 — should show "damaged" error directly 2. Test the same scenario with old p7zip 16.02 — behavior unchanged 3. Test opening a normal complete 7z archive — no regression fix: 兼容新版7-Zip分卷缺失时的"Cannot"输出 1. 根因:readListLine() 硬编码旧版 p7zip 输出的 "Can not"(两个单词), 新版 7-Zip 26.02 改为 "Cannot"(一个单词),匹配失败后走了 corrupt 对话框路径而非直接报错 2. 方案:追加 "Cannot" 的 startsWith 匹配分支,保留原有 "Can not" 匹配, 兼容旧版 p7zip 与新版 7-Zip 3. 影响:仅 readListLine() 中分卷缺失错误检测逻辑变化,旧版 p7zip 行为 保持不变 Log: 修复分卷缺失检测以支持新版7-Zip 26.02输出 Influence: 1. 使用新版 7-Zip 26.02 打开分卷缺失的 7z 压缩包,验证直接提示"损坏" 2. 使用旧版 p7zip 16.02 打开分卷缺失的 7z 压缩包,验证行为不变 3. 正常打开完整的 7z 压缩包,验证无回归 PMS: BUG-376699 --- 3rdparty/cli7zplugin/cli7zplugin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/3rdparty/cli7zplugin/cli7zplugin.cpp b/3rdparty/cli7zplugin/cli7zplugin.cpp index 9a53fa0b..f19d08bc 100644 --- a/3rdparty/cli7zplugin/cli7zplugin.cpp +++ b/3rdparty/cli7zplugin/cli7zplugin.cpp @@ -187,7 +187,9 @@ bool Cli7zPlugin::readListLine(const QString &line) static const QLatin1String entryInfoDelimiter("----------"); // 分隔符后面是内部压缩文件信息 // 加载时7z分卷文件不完整的情况 - if (line.startsWith(QLatin1String("Open ERROR: Can not open the file as [7z] archive"))) { + // 兼容旧版 p7zip 输出 "Can not"(两个单词)与新版 7-Zip 26.02 输出 "Cannot"(一个单词) + if (line.startsWith(QLatin1String("Open ERROR: Can not open the file as [7z] archive")) || + line.startsWith(QLatin1String("Open ERROR: Cannot open the file as [7z] archive"))) { m_eErrorType = ET_ArchiveDamaged; m_finishType = PFT_Error; return false;