Skip to content

fix: register zip split-volume mimetypes for consistent icon display - #468

Open
pengfeixx wants to merge 1 commit into
release/eaglefrom
agent/pms-bug-bot/ec60adc2
Open

fix: register zip split-volume mimetypes for consistent icon display#468
pengfeixx wants to merge 1 commit into
release/eaglefrom
agent/pms-bug-bot/ec60adc2

Conversation

@pengfeixx

@pengfeixx pengfeixx commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

修复内容

src/assets/mimetype/deepin-compressor.xml 中新增 application/zip mime-type 注册,覆盖 zip 分卷扩展名,绑定 generic-icon name="deepin-compressor",与现有 application/x-7z-compressed 处理方式对齐。

问题原因

deepin-compressor.xml 仅注册了 application/x-7z-compressed(glob *.7z.* + generic-icon),故 7z 分卷各分片图标一致;但 zip 分卷扩展名(*.z01*.zip.001 等)完全未注册,文管/gio 对这些分片回退到 application/octet-stream → 未知图标,与主 .zip 不一致。

修复方案

<mime-type type="application/zip">
    <generic-icon name="deepin-compressor"/>
    <glob pattern="*.z[0-9][0-9]"/>
    <glob pattern="*.zip.[0-9][0-9][0-9]"/>
</mime-type>
  • *.z[0-9][0-9]:覆盖 WinZip 风格分卷(如 xxx.z01),默认 weight 50,系统 *.z64(literal glob)同 weight 优先级更高,不受影响
  • *.zip.[0-9][0-9][0-9]:覆盖通用分卷风格(如 xxx.zip.001
  • generic-icon name="deepin-compressor":与 7z 一致,覆盖系统默认 package-x-generic

影响范围

仅修改 mime-type 注册 XML(+5 行),无 C++/CMake 代码变更,不影响应用内 mimetype 检测逻辑。

Log: PMS 268375

Summary by Sourcery

Bug Fixes:

  • Register ZIP split-volume extensions as application/zip files so their icons consistently use deepin-compressor instead of unknown-file icons.

Add application/zip mime-type registration in deepin-compressor.xml
to cover zip split-archive extensions (*.z01–*.z99, *.zip.001 etc.),
aligning with the existing application/x-7z-compressed handling.

- Bind generic-icon name="deepin-compressor" to match 7z and main zip
- glob *.z[0-9][0-9] covers WinZip-style splits (default weight 50,
  literal *.z64 still wins via higher specificity at same weight)
- glob *.zip.[0-9][0-9][0-9] covers generic-style splits

Log: PMS 268375

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @pengfeixx, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-ci-robot

Copy link
Copy Markdown

[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.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sourcery-ai

sourcery-ai Bot commented Aug 22, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Registers split-volume ZIP mimetypes in deepin-compressor’s MIME XML so that ZIP volume parts share the same compressor icon as the main archive, aligning behavior with existing 7z handling.

File-Level Changes

Change Details Files
Register application/zip split-volume patterns with the deepin-compressor generic icon to align ZIP volume icons with 7z handling.
  • Add a new mime-type block for application/zip in the MIME registration XML.
  • Bind the application/zip mime-type to the deepin-compressor generic icon so ZIP files and their split volumes show the compressor icon.
  • Register WinZip-style ZIP volume patterns (.z[0-9][0-9]) so they resolve to application/zip instead of falling back to application/octet-stream.
  • Register generic split ZIP volume patterns (.zip.[0-9][0-9][0-9]) to ensure all common ZIP parts share the same MIME type and icon.
src/assets/mimetype/deepin-compressor.xml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants