From b97f0ba00737b56197ae451d653456c4de78182c Mon Sep 17 00:00:00 2001 From: renpeijia Date: Thu, 21 Oct 2021 15:04:10 +0800 Subject: [PATCH] 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;