Skip to content

fix: revert QML netType rename, register NetType as uncreatable type - #614

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
52cyb:master
Sep 3, 2026
Merged

fix: revert QML netType rename, register NetType as uncreatable type#614
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
52cyb:master

Conversation

@52cyb

@52cyb 52cyb commented Sep 3, 2026

Copy link
Copy Markdown
Contributor
  1. Revert QML registration name "netType" back to "NetType" in dccnetwork.cpp
  2. Use qmlRegisterUncreatableMetaObject to expose NetType enums only
  3. Revert 101 netType. references to NetType. across 15 QML files

Influence:

  1. Fix "netType is not defined" ReferenceError at runtime
  2. Avoid "value type names should begin with lowercase" warning
  3. Confirm NetType enum values resolve correctly in QML

fix: 回退 QML netType 重命名,改用不可创建类型注册 NetType

  1. 将 dccnetwork.cpp 中 QML 注册名 "netType" 回退为 "NetType"
  2. 用 qmlRegisterUncreatableMetaObject 仅暴露 NetType 枚举值
  3. 将 15 个 QML 文件中 101 处 netType. 引用回退为 NetType.

Influence:

  1. 修复运行时 "netType is not defined" ReferenceError
  2. 避免出现 "value type names should begin with lowercase" 警告
  3. 确认 QML 中 NetType 枚举值解析正确 PMS: TASK-392413

Summary by Sourcery

Restore the NetType QML API and expose its enums without allowing instances to be created.

Bug Fixes:

  • Restore QML network enum references so NetType values resolve correctly at runtime and eliminate undefined-reference errors.

Enhancements:

  • Expose NetType as an uncreatable QML meta-object containing enums while preserving its established uppercase registration name.

@sourcery-ai

sourcery-ai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Reviewer's Guide

Restores the QML-facing type name to NetType and registers it as an uncreatable meta-object so its enums resolve without exposing an instantiable value type, then updates all networking QML references accordingly.

File-Level Changes

Change Details Files
Expose NetType only as an uncreatable QML meta-object while restoring its conventional uppercase registration name.
  • Replace qmlRegisterType with qmlRegisterUncreatableMetaObject using NetType::staticMetaObject.
  • Keep the existing module URI and version while providing a clear creation error message.
  • Continue registering NetItemModel and NetManager normally.
dcc-network/operation/dccnetwork.cpp
Update all QML enum and item-type references to the restored NetType name.
  • Replace 101 netType. references with NetType. across networking pages, sections, status handling, delegates, and proxy configuration.
  • Preserve enum comparisons, visibility logic, model selection, and action behavior while changing only the registered identifier.
  • Update SPDX copyright year headers in the affected QML files from 2026 to 2027.
dcc-network/qml/DeviceStatusItem.qml
dcc-network/qml/NetworkMain.qml
dcc-network/qml/PageDSL.qml
dcc-network/qml/PageDSLSettings.qml
dcc-network/qml/PageSettings.qml
dcc-network/qml/PageSystemProxy.qml
dcc-network/qml/PageVPN.qml
dcc-network/qml/PageVPNSettings.qml
dcc-network/qml/PageWiredDevice.qml
dcc-network/qml/PageWirelessDevice.qml
dcc-network/qml/SectionDevice.qml
dcc-network/qml/SectionGeneric.qml
dcc-network/qml/SectionIPv4.qml
dcc-network/qml/SectionIPv6.qml
dcc-network/qml/SectionSecret.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

@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 ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@52cyb
52cyb force-pushed the master branch 2 times, most recently from ad8ae5a to 6545a26 Compare September 3, 2026 09:27
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 52cyb, caixr23

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

1. Revert QML registration name "netType" back to "NetType" in dccnetwork.cpp
2. Use qmlRegisterUncreatableMetaObject to expose NetType enums only
3. Revert 101 netType. references to NetType. across 15 QML files

Influence:
1. Fix "netType is not defined" ReferenceError at runtime
2. Avoid "value type names should begin with lowercase" warning
3. Confirm NetType enum values resolve correctly in QML

fix: 回退 QML netType 重命名,改用不可创建类型注册 NetType

1. 将 dccnetwork.cpp 中 QML 注册名 "netType" 回退为 "NetType"
2. 用 qmlRegisterUncreatableMetaObject 仅暴露 NetType 枚举值
3. 将 15 个 QML 文件中 101 处 netType. 引用回退为 NetType.

Influence:
1. 修复运行时 "netType is not defined" ReferenceError
2. 避免出现 "value type names should begin with lowercase" 警告
3. 确认 QML 中 NetType 枚举值解析正确
PMS: TASK-392413
@52cyb

52cyb commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

This pr force merged! (status: unstable)

@deepin-bot
deepin-bot Bot merged commit cf138af into linuxdeepin:master Sep 3, 2026
13 of 14 checks passed
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