From b86710e5ed22477eb28eeec1f5b8a574a3c28466 Mon Sep 17 00:00:00 2001 From: liuxinhao Date: Fri, 18 Oct 2024 11:39:35 +0800 Subject: [PATCH] fix(Network): Fixes an issue with determining connection and NIC Mac configuration matches when a connection configuration change is active MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修复当连接配置更改激活时,判断连接和网卡Mac配置匹配,应考虑两个属性permanentHardwareAddress和hardwareAddress Closes #51089 --- .../src/plugin/device-available-connection-widget.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/network/src/plugin/device-available-connection-widget.cpp b/plugins/network/src/plugin/device-available-connection-widget.cpp index 1a255c30..adf14007 100644 --- a/plugins/network/src/plugin/device-available-connection-widget.cpp +++ b/plugins/network/src/plugin/device-available-connection-widget.cpp @@ -208,7 +208,15 @@ void DeviceAvailableConnectionWidget::updateConnection(const QString &connection return; } - if (m_wiredDevice->permanentHardwareAddress() == mac) + // 判断配置是否应该出现在该设备下,应判断两个属性permanentHardwareAddress,hardwareAddress + // 部分手机共享网络permanentHardwareAddress属性为空 + QString deviceMac = m_wiredDevice->permanentHardwareAddress(); + if (deviceMac.isEmpty()) + { + deviceMac = m_wiredDevice->hardwareAddress(); + } + + if (deviceMac == mac) { auto connection = findConnection(connectionPath); onAddConnection(connection); -- Gitee