fix: prioritize wired icon when both networks connected - #616
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates 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 selectionflowchart 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"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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
fcb113a to
9cf952d
Compare
|
TAG Bot New tag: 2.0.100 |
|
TAG Bot New tag: 2.0.101 |
deepin pr auto reviewAI 代码审查报告
总体评分:96/100 — 优秀
变更概述本次 PR 恢复启用(uncomment)了之前被注释掉的 修改文件:
变更统计:+9 行,-8 行,2 个文件 维度一:语法逻辑(22/25 ✓)
审查内容:
发现问题:
维度二:代码质量(24/25 ✓)
审查内容:
发现问题:
维度三:代码性能(20/20 ✓)
审查内容:
未发现性能问题。 维度四:代码安全(30/30 ✓)
审查内容:
漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个 改进建议1. 初始值语义优化(建议优先级:中)当前 // 方案A:初始值设为 Unknown,待网络检测后更新
, m_primaryConnectionType(NetManager::ConnectionType::Unknown)
// 方案B(当前方案):初始值设为 Wired,适用于优先显示有线图标的场景
, m_primaryConnectionType(NetManager::ConnectionType::Wired)若业务需求要求"默认优先显示有线"(即使尚未检测到网络),当前方案合理;若要求"未检测时显示未知",建议采用方案A。 2. 补充方法文档注释(建议优先级:低)为 审查结论本次 PR 的核心变更是恢复启用 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: caixr23, wjyrich 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 |
Log: Taskbar network icon now prioritizes wired connection display when multiple networks are active
Influence:
fix: 有线和无线同时连接时优先显示有线图标
Log: 当多网络同时连接时,任务栏网络图标优先显示有线连接
Influence:
PMS: BUG-375223
Summary by Sourcery
Prioritize the wired connection as the primary network type when multiple network connections are active.
Bug Fixes:
Enhancements: