From b318af3e92f3ae665fd1c934217055871289403f Mon Sep 17 00:00:00 2001 From: renpeijia Date: Thu, 21 Oct 2021 14:45:42 +0800 Subject: [PATCH 1/3] fix:kylin-nm can not disconnect ap connection, when close ap mode. bug link:http://172.17.66.192/biz/bug-view-86427.html --- src/frontend/tab-pages/wlanpage.cpp | 32 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/frontend/tab-pages/wlanpage.cpp b/src/frontend/tab-pages/wlanpage.cpp index a0cf2349..4650a217 100644 --- a/src/frontend/tab-pages/wlanpage.cpp +++ b/src/frontend/tab-pages/wlanpage.cpp @@ -756,14 +756,7 @@ void WlanPage::wlanShowNotify(QString ssid, NetworkManager::ActiveConnection::St void WlanPage::updateActivatedArea(QString uuid, QString ssid, QString devName) { - KyWirelessNetItem wirelessNetItem; - bool ret = m_wirelessNetResource->getWifiNetwork(devName, ssid, wirelessNetItem); - if (!ret) { - qWarning()<<"[WlanPage] get wireless item failed, when update activated connection area."; - return; - } - - if (m_activateConnectionItemMap.contains(wirelessNetItem.m_NetSsid)) { + if (m_activateConnectionItemMap.contains(ssid)) { return; } @@ -776,6 +769,13 @@ void WlanPage::updateActivatedArea(QString uuid, QString ssid, QString devName) m_inactivatedNetListWidget->height() + m_hiddenWlanLabel->height()); + KyWirelessNetItem wirelessNetItem; + bool ret = m_wirelessNetResource->getWifiNetwork(devName, ssid, wirelessNetItem); + if (!ret) { + qWarning()<<"[WlanPage] get wireless item failed, when update activated connection area."; + return; + } + deleteWirelessItemFormMap(m_activateConnectionItemMap, m_activatedNetListWidget, EMPTY_SSID); QListWidgetItem *p_listWidgetItem = addNewItem(wirelessNetItem, m_activatedNetListWidget); m_activateConnectionItemMap.insert(wirelessNetItem.m_NetSsid, p_listWidgetItem); @@ -787,14 +787,7 @@ void WlanPage::updateActivatedArea(QString uuid, QString ssid, QString devName) void WlanPage::updateWirelessNetArea(QString uuid, QString ssid, QString devName) { - KyWirelessNetItem wirelessNetItem; - bool ret = m_wirelessNetResource->getWifiNetwork(devName, ssid, wirelessNetItem); - if (!ret) { - qWarning()<<"[WlanPage] get wireless item failed, when update wireless area."; - return; - } - - if(m_wirelessNetItemMap.contains(wirelessNetItem.m_NetSsid)) { + if(m_wirelessNetItemMap.contains(ssid)) { return; } @@ -803,6 +796,13 @@ void WlanPage::updateWirelessNetArea(QString uuid, QString ssid, QString devName m_activateConnectionItemMap.insert(EMPTY_SSID, p_activeListWidgetItem); m_activatedNetListWidget->setFixedHeight(p_activeListWidgetItem->sizeHint().height()); + KyWirelessNetItem wirelessNetItem; + bool ret = m_wirelessNetResource->getWifiNetwork(devName, ssid, wirelessNetItem); + if (!ret) { + qWarning()<<"[WlanPage] get wireless item failed, when update wireless area."; + return; + } + QListWidgetItem *p_listWidgetItem = addNewItem(wirelessNetItem, m_inactivatedNetListWidget); m_wirelessNetItemMap.insert(wirelessNetItem.m_NetSsid, p_listWidgetItem); From 3b03be5fcc7ba5a27122ad09ec54700e705a1b0d Mon Sep 17 00:00:00 2001 From: renpeijia Date: Thu, 21 Oct 2021 14:52:07 +0800 Subject: [PATCH 2/3] fix:delete invalde message notify. bug link:http://172.17.66.192/biz/bug-view-85837.html --- src/frontend/tab-pages/wlanpage.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/frontend/tab-pages/wlanpage.cpp b/src/frontend/tab-pages/wlanpage.cpp index 4650a217..d3f5bf9a 100644 --- a/src/frontend/tab-pages/wlanpage.cpp +++ b/src/frontend/tab-pages/wlanpage.cpp @@ -836,8 +836,11 @@ void WlanPage::onConnectionStateChanged(QString uuid, return; } - sendApStateChangeSignal(uuid, ssid, devName, state); - wlanShowNotify(ssid, state, reason); + if (m_connectResource->isApConnection(uuid)) { + sendApStateChangeSignal(uuid, ssid, devName, state); + } else { + wlanShowNotify(ssid, state, reason); + } if (devName != m_currentDevice) { return; From b97f0ba00737b56197ae451d653456c4de78182c Mon Sep 17 00:00:00 2001 From: renpeijia Date: Thu, 21 Oct 2021 15:04:10 +0800 Subject: [PATCH 3/3] fix:it can not connect successfull, when connect ap with not password. bug link:http://172.17.66.192/biz/bug-view-81343.html --- src/frontend/list-items/wlanlistitem.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/frontend/list-items/wlanlistitem.cpp b/src/frontend/list-items/wlanlistitem.cpp index a910bd30..21352334 100644 --- a/src/frontend/list-items/wlanlistitem.cpp +++ b/src/frontend/list-items/wlanlistitem.cpp @@ -353,7 +353,7 @@ void WlanListItem::onNetButtonClicked() } //有配置或者无密码的wifi直接连接 - if (m_wirelessNetItem.m_isConfigured || m_hasPwd == false) { + if (m_wirelessNetItem.m_isConfigured) { m_wirelessConnectOperation->activeWirelessConnect(m_wlanDevice, m_wirelessNetItem.m_connectUuid); qDebug()<<"[WlanListItem] Has configuration, will be activated. ssid = " << m_wirelessNetItem.m_NetSsid << Q_FUNC_INFO << __LINE__; @@ -436,16 +436,17 @@ void WlanListItem::onShowPwdButtonClicked() void WlanListItem::onConnectButtonClicked() { qDebug()<< LOG_FLAG << "onConnectButtonClicked"; - if (!m_connectButton->isEnabled()) { - return; - } - if ((Activating == m_connectState || Deactivating == m_connectState)) { qDebug() << LOG_FLAG << "On wlan clicked! But there is nothing to do because it is already activating/deactivating!" << Q_FUNC_INFO << __LINE__; return; } + if (m_connectButton->isVisible() && !m_connectButton->isEnabled()) { + qWarning() << "Connect wlan failed because of null pointer or button state!" << Q_FUNC_INFO << __LINE__; + return; + } + KyWirelessConnectSetting settings; settings.m_connectName = m_wirelessNetItem.m_NetSsid; settings.m_ssid = m_wirelessNetItem.m_NetSsid;