fix(dock): eliminate several QML runtime/compile warnings - #1711
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Ivy233 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 GuideRemoves several QML runtime and registration warnings by making signal and view lookups safe, replacing the deprecated task-item add animation syntax, breaking dock sizing binding loops, supplying explicit drag-image sizes, and correcting the tray drop-index QML type name while preserving existing behavior. Flow diagram for warning-safe dock and notification behaviorflowchart LR
ShellSurface[Shell surface] -->|cursorShapeRequested| Proxy[ShellSurfaceItemProxy]
Proxy -->|ignore unknown signals| SafeSignal[Warning-free signal handling]
TaskModel[Task manager model] --> ListView[ListView]
ListView -->|add Transition| AddAnimation[Scale and opacity animation]
DockLayout[Dock layout] -->|useColumnLayout| DockSize[Return dockSize directly]
DockLayout -->|other direction| ContentSize[Compute content-based size]
DragItem[Dock or tray item] -->|grabToImage(width,height)| DragImage[Explicit-size drag image]
ListViewView[ListView.view] -->|exists| Overlap[panelShown lookup]
ListViewView -->|missing| Disabled[Animation disabled]
DropIndex[DropIndex gadget] -->|QML_NAMED_ELEMENT| dropIndex[dropIndex value type]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
c879751 to
c2e1cec
Compare
Fix a set of compiler and QML runtime warnings: - Enable -Werror for C/C++ and guard the clang-format targets so the build fails on warnings instead of silently ignoring them; only set up the format/commit hooks when clang-format is available. - Register the D_APPLET_CLASS macro as an AUTOMOC macro name for the notification server test to silence its moc warning. - AppletDockItem: coerce Applet.visible/supported to bool with !! operators to avoid assigning undefined to a bool property. - ShellSurfaceItemProxy: connect the cursorShapeRequested signal dynamically and only when the surface exposes it (PluginPopup), since a static Connections handler warned that no matching signal exists. - TaskManager: drop the implicitWidth/implicitHeight binding loop by returning the fixed dock size in the layout direction that does not depend on appContainer, and give the onAdd animation an id so the deprecated object-to-signal-handler assignment is avoided. - AppItem: resolve the Drag.active binding loop by setting Drag.active imperatively from the MouseArea's drag handler instead of binding it to the driving property. - TrayItemPositionManager: register the DropIndex value type under the lowercase name dropIndex via QML_NAMED_ELEMENT, so qmltyperegistrar stops warning about its value-type name while keeping the C++ struct name unchanged; also use Qt::QueuedConnection for the dockHeightChanged -> updateVisualSize connection to break the synchronous signal/slot cascade that causes the "Binding loop detected for dockItemMaxSize" warning. - OverlapNotify: guard the panelShown lookup so an undefined ListView.view no longer assigns undefined to a bool property. - Resolve dpkg -Wall -Werror build failures: reorder the member initializer list in AMAppItemModel to match the declaration order, drop the unused windowCount/initResult variables, and initialize the previously uninitialized needHide/needShow/anchor variables. 修复 dde-shell 及任务栏的编译与 QML 运行时告警: - 对 C/C++ 启用 -Werror,并将 clang-format 相关目标用条件包裹,让构建 在出现告警时报错而非静默跳过;仅在检测到 clang-format 时才构建 格式化与提交钩子目标。 - 为通知服务测试注册额外 moc 宏 D_APPLET_CLASS,消除其必要的 moc 告警。 - AppletDockItem:对 Applet.visible/Applet.supported 使用 !! 强制转换为 bool,避免将 undefined 赋给 bool 属性。 - ShellSurfaceItemProxy:将 cursorShapeRequested 改为仅在 surface 暴露该 信号时(PluginPopup)动态连接,原静态 Connections 处理器会因没有匹配 信号而告警。 - 通过在被布局方向直接返回固定的 dock 尺寸、不再依赖 appContainer, 消除 TaskManager 的 implicitWidth/implicitHeight 绑定循环;并为委托的 入场动画补充 id,规避已废弃的"将对象赋给信号处理器"写法。 - AppItem:改为在 mouseArea 的拖拽处理器中命令式设置 Drag.active, 而非绑定到驱动它的属性,消除 Drag.active 绑定循环告警。 - TrayItemPositionManager:通过 QML_NAMED_ELEMENT 将 DropIndex 值类型 注册为小写 dropIndex,在保留 C++ 结构体名的同时消除 qmltyperegistrar 对值类型名的告警;并将 dockHeightChanged 到 updateVisualSize 的连接 改为 Qt::QueuedConnection,打断同步 C++ 信号/槽级联,消除 "Binding loop detected for dockItemMaxSize" 告警。 - OverlapNotify:为 panelShown 查询加空值守卫,避免未定义的 ListView.view 将 undefined 赋给 bool 属性。 - 解决 dpkg -Wall -Werror 编译失败:调整 AMAppItemModel 的成员初始化 列表顺序使其与声明顺序一致,移除未使用的 windowCount/initResult 变量,并初始化先前未初始化的 needHide/needShow/anchor 变量。 PMS: TASK-394335
c2e1cec to
dfc6499
Compare
Log: fix multiple QML warnings reported by journalctl/qmltyperegistrar
Influence:
fix(dock): 消除任务栏与通知中心若干 QML 运行时/注册告警
Log: 修复 journalctl/qmltyperegistrar 报告的多项 QML 告警
Influence:
PMS: TASK-394379
Summary by Sourcery
Remove QML runtime and type-registration warnings across dock, task manager, tray, and notification components while preserving existing behavior.
Bug Fixes:
Enhancements: