From 1a210817f643407f02fbc5849a03f0738aecbc20 Mon Sep 17 00:00:00 2001 From: jzxc95 <907297917@qq.com> Date: Thu, 4 Nov 2021 16:06:03 +0800 Subject: [PATCH] fix:bug #89143 --- plugins/wlanconnect/wlanconnect.cpp | 12 +++++++----- src/frontend/tab-pages/wlanpage.cpp | 7 ++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/plugins/wlanconnect/wlanconnect.cpp b/plugins/wlanconnect/wlanconnect.cpp index 3225ffdd..5f693e3c 100644 --- a/plugins/wlanconnect/wlanconnect.cpp +++ b/plugins/wlanconnect/wlanconnect.cpp @@ -515,7 +515,7 @@ void WlanConnect::onActiveConnectionChanged(QString deviceName, QString ssid, QS for (itemIter = iter.value()->itemMap.begin(); itemIter != iter.value()->itemMap.end(); itemIter++) { if (itemIter.value()->uuid == uuid ) { item = itemIter.value(); - if (status == 4) { + if (status == DEACTIVATED) { itemIter.value()->uuid.clear(); } break; @@ -531,12 +531,14 @@ void WlanConnect::onActiveConnectionChanged(QString deviceName, QString ssid, QS for (int i = 0; i < deviceFrameMap[deviceName]->itemMap.size(); ++i) { if (deviceFrameMap[deviceName]->itemMap.contains(ssid)) { item = deviceFrameMap[deviceName]->itemMap[ssid]; - if (status == 2) { + if (status == ACTIVATED || status == ACTIVATING) { deviceFrameMap[deviceName]->itemMap[ssid]->uuid = uuid; deviceFrameMap[deviceName]->uuid = uuid; - deviceFrameMap[deviceName]->lanItemLayout->removeWidget(item); - deviceFrameMap[deviceName]->lanItemLayout->insertWidget(0,item); - } else if (status == 4) { + if (status == ACTIVATED) { + deviceFrameMap[deviceName]->lanItemLayout->removeWidget(item); + deviceFrameMap[deviceName]->lanItemLayout->insertWidget(0,item); + } + } else if (status == DEACTIVATED) { deviceFrameMap[deviceName]->itemMap[ssid]->uuid.clear(); deviceFrameMap[deviceName]->uuid.clear(); //todo 断开后排序 现在等下次更新列表 自动排序 diff --git a/src/frontend/tab-pages/wlanpage.cpp b/src/frontend/tab-pages/wlanpage.cpp index 2b8d9a00..7a444bda 100644 --- a/src/frontend/tab-pages/wlanpage.cpp +++ b/src/frontend/tab-pages/wlanpage.cpp @@ -995,6 +995,10 @@ void WlanPage::onWifiEnabledChanged(bool isWifiOn) void WlanPage::onRefreshIconTimer() { + if (!m_updateStrength) { + return; + } + emit timeToUpdate(); if(!this->isVisible()) { @@ -1012,9 +1016,6 @@ void WlanPage::onRefreshIconTimer() return; } - if (!m_updateStrength) { - return; - } QString activateSsid = m_activateConnectionItemMap.firstKey(); int sortRow = 0;