fix: rename QML value type NetType to netType to silence Qt6 naming warning - #605
fix: rename QML value type NetType to netType to silence Qt6 naming warning#60552cyb wants to merge 1 commit into
Conversation
1. Rename QML value type registration "NetType" to "netType" in dccnetwork.cpp to satisfy Qt6 value type naming convention 2. Update 101 NetType. references to netType. across 15 QML files 3. Keep C++ class name NetType and all NetType:: enum references unchanged Influence: 1. Verify no "Invalid QML element name" warning at runtime 2. Confirm network control center QML pages load and display correctly 3. Check NetType enum values resolve correctly in QML fix: 将 QML NetType 注册名改为 netType 1. 将 dccnetwork.cpp 中 QML 值类型注册名 "NetType" 改为 "netType",符合 Qt6 值类型命名约定 2. 更新 15 个 QML 文件中 101 处 NetType. 引用为 netType. 3. C++ 类名 NetType 及所有 NetType:: 枚举引用保持不变 Influence: 1. 验证运行时不再出现 "Invalid QML element name" 警告 2. 确认控制中心网络 QML 页面加载和显示正常 3. 检查 QML 中 NetType 枚举值解析正确
|
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 GuideThis PR renames the QML value type exposure of the C++ Q_GADGET NetType from the invalid Qt6 value type name "NetType" to the lowercase "netType" and updates all QML enum usages accordingly, eliminating a Qt6 runtime warning without changing the underlying C++ enum container or import URIs. Sequence diagram for QML value type registration of NetType as netTypesequenceDiagram
participant DccNetwork
participant QMLEngine
actor QMLView
DccNetwork->>QMLEngine: qmlRegisterType<NetType>(org.deepin.dcc.network,1,0,netType)
QMLView->>QMLEngine: read netType.DS_Connected
QMLEngine-->>QMLView: DS_Connected
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Fix:
Invalid QML element name "NetType"warningFixes the runtime warning:
Root cause
NetTypeis declared as aQ_GADGETclass (an enum container, never instantiated) innet-view/operation/nettype.h. In Qt6,Q_GADGETtypes are registered as value types, and value type names must begin with a lowercase letter. It was registered with an uppercase name"NetType"indcc-network/operation/dccnetwork.cpp:32, triggering the warning.Changes
dcc-network/operation/dccnetwork.cpp:32: changed the 4th argument ofqmlRegisterType<NetType>(...)from"NetType"to"netType"(the C++ template parameter<NetType>is unchanged).dcc-network/qml/: updated 101NetType.references tonetType.across 15 QML files (enum value accesses only;import org.deepin.dcc.network 1.0URIs unchanged).NetTypeand allNetType::enum references remain unchanged — only the QML element name is renamed.Total: 16 files changed, 99 insertions(+), 99 deletions(-).
Verification (already passed)
Invalid QMLwarnings: 0 (target warning eliminated). 6 binary deb packages generated normally.Multica issue
DDE-148: dde-network-core: QML 类型注册警告 NetType 值类型名应以小写字母开头
Summary by Sourcery
Rename the network QML value type to comply with Qt6 naming requirements and remove the resulting runtime warning.
Bug Fixes:
Enhancements:
netTypevalue type while preserving the C++ type and module URI.Tests: