Skip to content

fix: decouple specialCpuTarGzCompressor dconfig read from m_isOrderMode gate - #467

Open
add-uos wants to merge 1 commit into
linuxdeepin:release/eaglefrom
add-uos:fix/pms-273093-tar-gz-cpu-config
Open

fix: decouple specialCpuTarGzCompressor dconfig read from m_isOrderMode gate#467
add-uos wants to merge 1 commit into
linuxdeepin:release/eaglefrom
add-uos:fix/pms-273093-tar-gz-cpu-config

Conversation

@add-uos

@add-uos add-uos commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

fix: decouple specialCpuTarGzCompressor dconfig read from m_isOrderMode gate

The CPU thread count config (specialCpuTarGzCompressor) for tar.gz was
gated behind m_isOrderMode, which defaults to false because
specialCustomizedType defaults to -1. This caused the dconfig value to
never be read, so the UI always fell back to max threads (8) regardless
of the configured value.

Fix by reading specialCpuTarGzCompressor independently of m_isOrderMode
in both refreshCompressLevel() and slotAdvancedEnabled(). Also remove
the duplicate dead-code tar.gz branch in refreshCompressLevel().

Log: fix tar.gz CPU thread count not applying from dconfig
Bug: https://pms.uniontech.com/bug-view-273093

Summary by Sourcery

Apply tar.gz CPU thread settings independently of order mode so configured values are honored consistently.

Bug Fixes:

  • Ensure the configured tar.gz CPU thread count is applied from dconfig regardless of order mode.

Enhancements:

  • Remove redundant tar.gz compressor handling from compression-level refresh logic.

…de gate

The CPU thread count config (specialCpuTarGzCompressor) for tar.gz was
gated behind m_isOrderMode, which defaults to false because
specialCustomizedType defaults to -1. This caused the dconfig value to
never be read, so the UI always fell back to max threads (8) regardless
of the configured value.

Fix by reading specialCpuTarGzCompressor independently of m_isOrderMode
in both refreshCompressLevel() and slotAdvancedEnabled(). Also remove
the duplicate dead-code tar.gz branch in refreshCompressLevel().

Log: fix tar.gz CPU thread count not applying from dconfig
Bug: https://pms.uniontech.com/bug-view-273093

@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 @add-uos, 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: add-uos

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

Decouples tar.gz CPU thread count configuration from the m_isOrderMode gate so the dconfig value is always applied when available, and removes redundant dead code for tar.gz handling.

Sequence diagram for applying tar.gz CPU configuration

sequenceDiagram
    participant CompressSettingPage
    participant DConfig
    participant CpuComboBox

    CompressSettingPage->>CompressSettingPage: refreshCompressLevel(strType)
    alt strType == tar.gz
        CompressSettingPage->>DConfig: isValid()
        CompressSettingPage->>DConfig: keyList()
        DConfig-->>CompressSettingPage: specialCpuTarGzCompressor available
        CompressSettingPage->>DConfig: value(specialCpuTarGzCompressor)
        DConfig-->>CompressSettingPage: CPU thread index
        CompressSettingPage->>CpuComboBox: setCurrentIndex(nCpu)
    end

    CompressSettingPage->>CompressSettingPage: slotAdvancedEnabled(bEnabled)
    alt tar.gz selected
        CompressSettingPage->>CpuComboBox: setCurrentIndex(count() - 1)
        CompressSettingPage->>DConfig: value(specialCpuTarGzCompressor)
        DConfig-->>CompressSettingPage: CPU thread index
        CompressSettingPage->>CpuComboBox: setCurrentIndex(nCpu)
    end
Loading

File-Level Changes

Change Details Files
Always read and apply specialCpuTarGzCompressor for tar.gz independently of m_isOrderMode in both refreshCompressLevel and slotAdvancedEnabled.
  • In refreshCompressLevel, before the m_isOrderMode check, read specialCpuTarGzCompressor from DConfig for tar.gz and set the CPU combo index when the key exists.
  • In slotAdvancedEnabled, remove the m_isOrderMode guard around the specialCpuTarGzCompressor DConfig read so tar.gz CPU value is applied whenever advanced options are enabled and configuration is valid.
src/source/page/compresssettingpage.cpp
Clean up redundant tar.gz branch and dead code in refreshCompressLevel.
  • Remove the duplicated tar.gz branch that only sets specialTarGzCompressor, leaving a single, clearer handling path for tar.gz compression settings.
  • Eliminate the inlined CPU combo update from within the m_isOrderMode tar.gz branch, since CPU handling is now centralized before the order-mode logic.
src/source/page/compresssettingpage.cpp

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.

3 participants