From ef175497dcffe5b01a3ea6e7efe5a8edcfa226ee Mon Sep 17 00:00:00 2001 From: kangshuning Date: Fri, 29 Oct 2021 17:38:14 +0800 Subject: [PATCH] bug#86526 --- src/frontend/tab-pages/wlanpage.cpp | 8 ++++++++ src/frontend/tab-pages/wlanpage.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/frontend/tab-pages/wlanpage.cpp b/src/frontend/tab-pages/wlanpage.cpp index 0ada23c5..76027277 100644 --- a/src/frontend/tab-pages/wlanpage.cpp +++ b/src/frontend/tab-pages/wlanpage.cpp @@ -872,23 +872,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); @@ -1019,6 +1023,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 7784d224..a583f1f0 100644 --- a/src/frontend/tab-pages/wlanpage.h +++ b/src/frontend/tab-pages/wlanpage.h @@ -168,6 +168,8 @@ private: QGSettings *m_switchGsettings = nullptr; bool m_wlanSwitchEnable = true; + bool m_updateStrength = true; + QTimer *m_scanTimer = nullptr; QTimer *m_refreshIconTimer = nullptr; };