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;