Merge branch '2309-0822' into 'yhkylin/v101'

fix(托盘WLAN): 避免重复添加相同SSID的WiFi(bug#188238)

See merge request kylinos-src/kylin-nm!248
This commit is contained in:
赵世旭 2023-08-22 06:07:03 +00:00
commit ac8fb3aa15
2 changed files with 7 additions and 0 deletions

View File

@ -404,6 +404,12 @@ void KyWirelessNetResource::onWifiNetworkAdded(QString devIfaceName, QString ssi
KyWirelessNetItem item(wifi); KyWirelessNetItem item(wifi);
if (m_WifiNetworkList.contains(devIfaceName)) { if (m_WifiNetworkList.contains(devIfaceName)) {
for (int index = 0; index < m_WifiNetworkList[devIfaceName].size(); ++index) {
if (m_WifiNetworkList[devIfaceName].at(index).m_NetSsid == item.m_NetSsid) {
m_WifiNetworkList[devIfaceName].removeAt(index);
index--;
}
}
m_WifiNetworkList[devIfaceName].append(item); m_WifiNetworkList[devIfaceName].append(item);
} else { } else {
QList<KyWirelessNetItem> list; QList<KyWirelessNetItem> list;

View File

@ -637,6 +637,7 @@ void WlanPage::onWlanRemoved(QString interface, QString ssid)
QListWidgetItem *p_listWidgetItem = addEmptyItem(m_activatedNetListWidget); QListWidgetItem *p_listWidgetItem = addEmptyItem(m_activatedNetListWidget);
m_activateConnectionItemMap.insert(EMPTY_SSID, p_listWidgetItem); m_activateConnectionItemMap.insert(EMPTY_SSID, p_listWidgetItem);
m_activatedNetListWidget->setSelectionMode(QAbstractItemView::SelectionMode::NoSelection);
} }
return; return;