Skip to content

fix: prioritize wired icon when both networks connected - #616

Open
wjyrich wants to merge 1 commit into
linuxdeepin:masterfrom
wjyrich:fix-bug-375223
Open

fix: prioritize wired icon when both networks connected#616
wjyrich wants to merge 1 commit into
linuxdeepin:masterfrom
wjyrich:fix-bug-375223

Conversation

@wjyrich

@wjyrich wjyrich commented Sep 8, 2026

Copy link
Copy Markdown
Contributor
  1. Add logic to prefer wired network icon in taskbar when both wired and wireless networks are simultaneously connected and both can access the internet
  2. The new condition checks NetworkStatus::Connected state and overrides the connection type to Wired
  3. This affects the updateNetworkIcon() function in netstatus.cpp

Log: Taskbar network icon now prioritizes wired connection display when multiple networks are active

Influence:

  1. Connect both wired and wireless networks simultaneously and verify the taskbar shows the wired network icon
  2. Test with only wireless connected to confirm wireless icon still displays correctly
  3. Verify icon updates correctly when network status changes between connected and disconnected states
  4. Test with wired only, wireless only, and both connected scenarios
  5. Confirm proper behavior when networks have different internet access statuses

fix: 有线和无线同时连接时优先显示有线图标

  1. 在有线网络和无线网络同时连接且均可上网时,任务栏图标优先显示有线网络 图标
  2. 新增条件判断 NetworkStatus::Connected 状态并将连接类型强制设置为有 线 Wired
  3. 修改 netstatus.cpp 文件中的 updateNetworkIcon() 函数

Log: 当多网络同时连接时,任务栏网络图标优先显示有线连接

Influence:

  1. 同时连接有线和无线网络,验证任务栏显示有线网络图标
  2. 仅连接无线网络,确认无线图标仍能正确显示
  3. 验证网络状态在连接和断开状态切换时图标更新是否正确
  4. 测试仅有线连接、仅无线连接和双网络同时连接三种场景
  5. 确认不同网络上网状态不一致时的图标显示行为正确

PMS: BUG-375223

Summary by Sourcery

Prioritize wired connectivity by making the network manager’s primary connection type stateful and observable.

Bug Fixes:

  • Track and expose the primary network connection type so the taskbar can consistently prioritize the wired connection when appropriate.

Enhancements:

  • Restore primary connection type state management and emit change notifications when the active connection type changes.

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: wjyrich

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 network icon selection so an aggregate Connected state, representing simultaneously usable wired and wireless networks, displays the wired icon while preserving existing handling for other connection states.

Flow diagram for network icon selection

flowchart TD
    A["updateNetworkIcon()"] --> B{"networkStatus()"}
    B -->|Connected| C["type = Wired"]
    B -->|Other states| D["Preserve existing connection type"]
    C --> E{"type"}
    D --> E
    E -->|Wireless| F["Display wireless icon"]
    E -->|Wired| G["Display wired icon"]
Loading

File-Level Changes

Change Details Files
Prioritize the wired taskbar icon when both wired and wireless connections are active and internet-accessible.
  • Detect the aggregate NetworkStatus::Connected state.
  • Override the selected connection type to Wired before selecting the corresponding icon.
  • Leave wireless icon lookup unchanged for wireless-only or other non-aggregate states.
net-view/window/netstatus.cpp

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 ✨

Comment thread net-view/window/netstatus.cpp
1. Implemented primaryConnectionType() getter to return tracked
connection type
2. Initialized m_primaryConnectionType to Wired in constructor
3. Enabled updatePrimaryConnectionType() method with signal emission
4. Added m_primaryConnectionType member in private data class

Log: 新增主连接类型跟踪功能

Influence:
1. Test primaryConnectionType() returns default Wired at initialization
2. Verify updatePrimaryConnectionType() correctly updates when
connection changes
3. Test primaryConnectionTypeChanged signal is emitted with new
connection type
4. Test different connection types (Wired, Wireless, etc.) in various
network scenarios
5. Verify no regression in airplane mode functionality

feat: 启用主连接类型跟踪功能

1. 实现 primaryConnectionType() 查询当前跟踪的连接类型
2. 在构造函数中将 m_primaryConnectionType 初始化为有线连接
3. 启用 updatePrimaryConnectionType() 方法并支持信号发射
4. 在私有数据类中添加 m_primaryConnectionType 成员变量

Log: 新增主连接类型跟踪功能

Influence:
1. 测试 primaryConnectionType() 在初始化时返回默认的有线类型
2. 验证 updatePrimaryConnectionType() 在连接状态变化时正确更新
3. 测试 primaryConnectionTypeChanged 信号在连接类型变化时正确发射
4. 在各种网络场景下测试不同连接类型(有线、无线等)的区分
5. 验证飞行模式功能无回归问题

PMS: BUG-375223
@deepin-bot

deepin-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

TAG Bot

New tag: 2.0.100
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #621

@deepin-bot

deepin-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

TAG Bot

New tag: 2.0.101
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #625

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