fix: add zip split archive MIME icon definition - #469
Open
pengfeixx wants to merge 1 commit into
Open
Conversation
1. Root cause: deepin-compressor.xml only defines MIME type and generic-icon for 7z split archives, missing zip split sub-files 2. Fix: add application/x-zip-split MIME type with glob patterns *.zip.[0-9]* and *.z[0-9]* to cover both zip split naming formats 3. Impact: zip split sub-files now display deepin-compressor icon Log: zip split archive sub-files now show consistent deepin-compressor icon Influence: 1. Verify zip split format A (.zip.001, .zip.002...) sub-file icons 2. Verify zip split format B (.z01, .z02...) sub-file icons 3. Verify 7z split and regular zip icons are unaffected fix: 补充zip分卷压缩包子文件MIME图标定义 1. 根因:deepin-compressor.xml 仅定义了 7z 分卷的 MIME 类型和 generic-icon,缺少 zip 分卷子文件的定义 2. 方案:新增 application/x-zip-split MIME 类型,glob 模式 *.zip.[0-9]* 和 *.z[0-9]* 覆盖 zip 分卷两种命名格式 3. 影响:zip 分卷子文件图标统一显示为 deepin-compressor 图标 Log: zip分卷压缩包子文件图标统一显示为deepin-compressor图标 Influence: 1. 验证zip分卷格式A(.zip.001、.zip.002...)子文件图标 2. 验证zip分卷格式B(.z01、.z02...)子文件图标 3. 验证7z分卷和普通zip文件图标不受影响 PMS: BUG-268375
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pengfeixx 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 |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds a new MIME type definition for ZIP split archive parts to the deepin-compressor MIME XML so that split ZIP sub-files get the deepin-compressor icon, mirroring the existing 7z split handling, without changing any existing MIME entries. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root Cause Analysis
The deepin-compressor MIME package (
src/assets/mimetype/deepin-compressor.xml) only defines a custom MIME type withgeneric-icon=deepin-compressorfor 7z split archives (application/x-7z-compressed+ glob*.7z.*). Zip split archive sub-files have no MIME/glob/icon definition, so they fall back to generic or unknown icons in the file manager, causing icon inconsistency between the main archive and its parts. The two zip split naming formats are confirmed insrc/source/common/uitools.cpp:342transSplitFileName: format A (.zip.001,.zip.002…) and format B (.zip+.z01,.z02…).Fix
Added a new
<mime-type type="application/x-zip-split">entry todeepin-compressor.xml, with two glob patterns (*.zip.[0-9]*and*.z[0-9]*, both at weight 80) covering both zip split naming formats, andgeneric-icon=deepin-compressorto ensure sub-files display the same icon as the main archive. The new entry follows the existing 7z split definition pattern and does not modify any existing definitions.Change Safety Assessment
Code Safety
References=0.Business Impact Scope
.zip.001/.zip.002… and.z01/.z02…) will now display the deepin-compressor icon..zip+.z0N) main.zipfile still matches the systemapplication/zipMIME type and shows the system zip icon. Overridingapplication/zip'sgeneric-iconwould affect ALL zip files (including non-split regular zip), so this is intentionally NOT done. The main/sub icon difference for format B remains and is documented here as a known limitation.Verification Suggestion
Verify that both zip split naming formats show the deepin-compressor icon for sub-files, and that 7z split and regular zip icons are unchanged.
根因分析
归档管理器 MIME 包(
src/assets/mimetype/deepin-compressor.xml)仅对 7z 分卷定义了自定义 MIME 类型及generic-icon=deepin-compressor(application/x-7z-compressed+ glob*.7z.*),zip 分卷子文件缺少 MIME/glob/icon 定义,在文件管理器中回退为通用/未知图标,导致主文件与子文件图标显示不一致。两种 zip 分卷命名格式在src/source/common/uitools.cpp:342transSplitFileName中确认:格式 A(.zip.001、.zip.002…)与格式 B(.zip+.z01、.z02…)。修复方案
在
deepin-compressor.xml中新增<mime-type type="application/x-zip-split">条目,配置两个 glob 模式(*.zip.[0-9]*和*.z[0-9]*,weight 80)覆盖 zip 分卷两种命名格式,并设置generic-icon=deepin-compressor使子文件与主文件图标一致。新增条目参照已有 7z 分卷定义模式,不修改任何已有定义。改动安全评估
代码安全评估
References=0。业务影响范围
.zip.001/.zip.002… 和.z01/.z02…)将统一显示 deepin-compressor 图标。.zip+.z0N)主文件.zip仍命中系统application/zip类型,显示系统 zip 图标。覆盖application/zip的generic-icon会影响所有 zip 文件(含非分卷普通 zip),风险过高,本次有意不做覆盖。格式 B 主/子图标差异作为已知限制在此说明。验证建议
验证两种 zip 分卷命名格式的子文件均显示 deepin-compressor 图标,且 7z 分卷和普通 zip 图标无变化。
PMS: BUG-268375
Summary by Sourcery
Bug Fixes: