diff --git a/src/frontend/tab-pages/wlanpage.cpp b/src/frontend/tab-pages/wlanpage.cpp index e47f7cc0..9eb44a23 100644 --- a/src/frontend/tab-pages/wlanpage.cpp +++ b/src/frontend/tab-pages/wlanpage.cpp @@ -860,23 +860,27 @@ void WlanPage::onConnectionStateChanged(QString uuid, qDebug()<< "[WlanPage] wlan state changed, ssid = " << ssid << "; state = " << state << "; reason = " << reason << Q_FUNC_INFO <<__LINE__; if (state == NetworkManager::ActiveConnection::State::Activated) { + m_updateStrength = true; updateActivatedArea(uuid, ssid, devName); if (m_activateConnectionItemMap.contains(ssid)) { QListWidgetItem *p_listWidgetItem = m_activateConnectionItemMap.value(ssid); updateWlanItemState(m_activatedNetListWidget, p_listWidgetItem, Activated); } } else if (state == NetworkManager::ActiveConnection::State::Deactivated) { + m_updateStrength = true; updateWirelessNetArea(uuid, ssid, devName); if (m_wirelessNetItemMap.contains(ssid)) { QListWidgetItem *p_listWidgetItem = m_wirelessNetItemMap.value(ssid); updateWlanItemState(m_inactivatedNetListWidget, p_listWidgetItem, Deactivated); } } else if (state == NetworkManager::ActiveConnection::State::Deactivating){ + m_updateStrength = false; if (m_activateConnectionItemMap.contains(ssid)) { QListWidgetItem *p_listWidgetItem = m_activateConnectionItemMap.value(ssid); updateWlanItemState(m_activatedNetListWidget, p_listWidgetItem, Deactivating); } } else if (state == NetworkManager::ActiveConnection::State::Activating) { + m_updateStrength = false; if (m_wirelessNetItemMap.contains(ssid)) { QListWidgetItem *p_listWidgetItem = m_wirelessNetItemMap.value(ssid); updateWlanItemState(m_inactivatedNetListWidget, p_listWidgetItem, Activating); @@ -1007,6 +1011,10 @@ void WlanPage::onRefreshIconTimer() return; } + if (!m_updateStrength) { + return; + } + QString activateSsid = m_activateConnectionItemMap.firstKey(); int sortRow = 0; for (int index = 0; index < wlanList.length(); index++) { diff --git a/src/frontend/tab-pages/wlanpage.h b/src/frontend/tab-pages/wlanpage.h index 6a72d472..ad02a945 100644 --- a/src/frontend/tab-pages/wlanpage.h +++ b/src/frontend/tab-pages/wlanpage.h @@ -166,6 +166,8 @@ private: QGSettings *m_switchGsettings = nullptr; bool m_wlanSwitchEnable = true; + bool m_updateStrength = true; + QTimer *m_scanTimer = nullptr; QTimer *m_refreshIconTimer = nullptr; };