fix: use formal parameter in ThemeMenu signal handler - #680
Conversation
|
Skipping CI for Draft Pull Request. |
|
[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. 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 GuideUpdates ThemeMenu’s ActionGroup trigger handler to use an explicit Sequence diagram for explicit ThemeMenu action handlingsequenceDiagram
participant User
participant ActionGroup
participant ThemeMenu
participant ApplicationHelper
User->>ActionGroup: trigger(action)
ActionGroup->>ThemeMenu: onTriggered(action)
ThemeMenu->>ApplicationHelper: setPaletteType(action.themeType)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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
053f0d6 to
6ee16c5
Compare
|
TAG Bot New tag: 6.7.49 |
修复 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:
Chores: