Merge branch 'new-dbus' into 'dbus-interface'

fix when ap remove segament fault & can not remove a item

See merge request kylin-desktop/kylin-nm!191
This commit is contained in:
ren peijia 2021-08-26 02:29:54 +00:00
commit c3ecbd5f22
2 changed files with 3 additions and 5 deletions

View File

@ -93,7 +93,6 @@ void KyWirelessNetResource::getWirelessActiveConnection(NetworkManager::ActiveCo
map.clear();
NetworkManager::ActiveConnection::List activeConnectionList;
map.clear();
activeConnectionList.clear();
activeConnectionList = m_networkResourceInstance->m_activeConns;
if (activeConnectionList.isEmpty()) {

View File

@ -203,10 +203,9 @@ void WlanPage::onWlanRemoved(QString interface, QString ssid)
{
if (!m_itemsMap.contains(ssid)) { return; }
qDebug() << "A Wlan Removed! interface = " << interface << "; ssid = " << ssid << Q_FUNC_INFO <<__LINE__;
m_inactivatedNetListWidget->removeItemWidget(m_itemsMap.value(ssid));
m_inactivatedNetListWidget->setFixedHeight(m_inactivatedNetListWidget->height() -
m_inactivatedNetListWidget->itemWidget(m_itemsMap.value(ssid))->height() -
NET_LIST_SPACING);
int height = m_inactivatedNetListWidget->itemWidget(m_itemsMap.value(ssid))->height();
m_inactivatedNetListWidget->takeItem(m_inactivatedNetListWidget->row(m_itemsMap.value(ssid)));
m_inactivatedNetListWidget->setFixedHeight(m_inactivatedNetListWidget->height() - height - NET_LIST_SPACING);
m_inactivatedWlanListAreaCentralWidget->setFixedHeight(m_inactivatedNetListWidget->height() + m_hiddenWlanLabel->height());
m_itemsMap.remove(ssid);
}