Skip to content

fix: use formal parameter in ThemeMenu signal handler - #680

Open
52cyb wants to merge 1 commit into
linuxdeepin:masterfrom
52cyb:agent/bot/372660737027
Open

fix: use formal parameter in ThemeMenu signal handler#680
52cyb wants to merge 1 commit into
linuxdeepin:masterfrom
52cyb:agent/bot/372660737027

Conversation

@52cyb

@52cyb 52cyb commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

修复 ThemeMenu.qml 信号处理器参数注入弃用警告

改动内容

将 qt6/src/qml/ThemeMenu.qml 第 17 行的 onTriggered: { 修改为 onTriggered: function(action) {,使用 Qt6 要求的 JavaScript 函数形式参数语法,消除信号参数隐式注入弃用警告。

背景

控制中心切换主题时,控制台输出弃用警告:Parameter "action" is not declared. Injection of parameters into signal handlers is deprecated. Use JavaScript functions with formal parameters instead.

ActionGroup.triggered(Action action) 信号带 action 参数,Qt6 要求信号处理器以 function(param) 形式声明形式参数,而非隐式注入。

Multica Issue

DDE-226

Summary by Sourcery

Use an explicit formal parameter in the ThemeMenu action handler to maintain Qt 6 compatibility and eliminate deprecation warnings.

Bug Fixes:

  • Update the ThemeMenu signal handler to declare its action parameter explicitly, removing the Qt 6 deprecation warning caused by implicit parameter injection.

Chores:

  • Update the ThemeMenu copyright year through 2026.

@deepin-ci-robot

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@deepin-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 52cyb

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 Sep 8, 2026

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

Reviewer's Guide

Updates ThemeMenu’s ActionGroup trigger handler to use an explicit action formal parameter, preserving theme selection behavior while eliminating the Qt6 deprecation warning; also refreshes the copyright year.

Sequence diagram for explicit ThemeMenu action handling

sequenceDiagram
    participant User
    participant ActionGroup
    participant ThemeMenu
    participant ApplicationHelper

    User->>ActionGroup: trigger(action)
    ActionGroup->>ThemeMenu: onTriggered(action)
    ThemeMenu->>ApplicationHelper: setPaletteType(action.themeType)
Loading

File-Level Changes

Change Details Files
Declare the ActionGroup signal argument explicitly in the QML handler to comply with Qt6 signal-handler syntax and remove the deprecated implicit parameter injection.
  • Change the handler to function(action) form.
  • Continue passing the declared action to setPaletteType for theme switching.
  • Update the SPDX copyright year range through 2026.
qt6/src/qml/ThemeMenu.qml

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

@52cyb
52cyb marked this pull request as ready for review September 8, 2026 05:05

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

1. Change onTriggered to function(action) syntax in qt6/src/qml/ThemeMenu.qml
2. Fix Qt6 deprecation warning about implicit signal parameter injection
3. Keep consistent with other signal handlers in the repository
4. Update SPDX copyright year to 2026

Influence:
1. Test theme switching (Light/Dark/System) in dde-control-center
2. Verify no deprecation warning in console output
3. Confirm Qt5 build is unaffected by the change

fix: 修复 ThemeMenu 信号处理器参数注入弃用警告

1. 修改 qt6/src/qml/ThemeMenu.qml 中 onTriggered 为 function(action) 语法
2. 修复 Qt6 关于信号参数隐式注入的弃用警告
3. 与仓库中其他信号处理器保持风格一致
4. 更新 SPDX 版权年份至 2026

Influence:
1. 在控制中心测试主题切换(浅色/深色/跟随系统)
2. 验证控制台不再输出弃用警告
3. 确认 Qt5 构建不受此改动影响

PMS: TASK-392413
@52cyb
52cyb force-pushed the agent/bot/372660737027 branch from 053f0d6 to 6ee16c5 Compare September 8, 2026 05:09
@deepin-bot

deepin-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

TAG Bot

New tag: 6.7.49
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #685

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