Merge branch '1104' into 'dbus-interface'

fix:bug #89143

See merge request kylin-desktop/kylin-nm!383
This commit is contained in:
ren peijia 2021-11-05 02:30:34 +00:00
commit 33d00c23d7
2 changed files with 11 additions and 8 deletions

View File

@ -515,7 +515,7 @@ void WlanConnect::onActiveConnectionChanged(QString deviceName, QString ssid, QS
for (itemIter = iter.value()->itemMap.begin(); itemIter != iter.value()->itemMap.end(); itemIter++) { for (itemIter = iter.value()->itemMap.begin(); itemIter != iter.value()->itemMap.end(); itemIter++) {
if (itemIter.value()->uuid == uuid ) { if (itemIter.value()->uuid == uuid ) {
item = itemIter.value(); item = itemIter.value();
if (status == 4) { if (status == DEACTIVATED) {
itemIter.value()->uuid.clear(); itemIter.value()->uuid.clear();
} }
break; break;
@ -531,12 +531,14 @@ void WlanConnect::onActiveConnectionChanged(QString deviceName, QString ssid, QS
for (int i = 0; i < deviceFrameMap[deviceName]->itemMap.size(); ++i) { for (int i = 0; i < deviceFrameMap[deviceName]->itemMap.size(); ++i) {
if (deviceFrameMap[deviceName]->itemMap.contains(ssid)) { if (deviceFrameMap[deviceName]->itemMap.contains(ssid)) {
item = deviceFrameMap[deviceName]->itemMap[ssid]; item = deviceFrameMap[deviceName]->itemMap[ssid];
if (status == 2) { if (status == ACTIVATED || status == ACTIVATING) {
deviceFrameMap[deviceName]->itemMap[ssid]->uuid = uuid; deviceFrameMap[deviceName]->itemMap[ssid]->uuid = uuid;
deviceFrameMap[deviceName]->uuid = uuid; deviceFrameMap[deviceName]->uuid = uuid;
deviceFrameMap[deviceName]->lanItemLayout->removeWidget(item); if (status == ACTIVATED) {
deviceFrameMap[deviceName]->lanItemLayout->insertWidget(0,item); deviceFrameMap[deviceName]->lanItemLayout->removeWidget(item);
} else if (status == 4) { deviceFrameMap[deviceName]->lanItemLayout->insertWidget(0,item);
}
} else if (status == DEACTIVATED) {
deviceFrameMap[deviceName]->itemMap[ssid]->uuid.clear(); deviceFrameMap[deviceName]->itemMap[ssid]->uuid.clear();
deviceFrameMap[deviceName]->uuid.clear(); deviceFrameMap[deviceName]->uuid.clear();
//todo 断开后排序 现在等下次更新列表 自动排序 //todo 断开后排序 现在等下次更新列表 自动排序

View File

@ -995,6 +995,10 @@ void WlanPage::onWifiEnabledChanged(bool isWifiOn)
void WlanPage::onRefreshIconTimer() void WlanPage::onRefreshIconTimer()
{ {
if (!m_updateStrength) {
return;
}
emit timeToUpdate(); emit timeToUpdate();
if(!this->isVisible()) { if(!this->isVisible()) {
@ -1012,9 +1016,6 @@ void WlanPage::onRefreshIconTimer()
return; return;
} }
if (!m_updateStrength) {
return;
}
QString activateSsid = m_activateConnectionItemMap.firstKey(); QString activateSsid = m_activateConnectionItemMap.firstKey();
int sortRow = 0; int sortRow = 0;