相同信号强度和配置 根据ssid排序

This commit is contained in:
jzxc95 2021-12-01 15:54:41 +08:00
parent 5966e0299e
commit 4a53df57c0
2 changed files with 10 additions and 1 deletions

View File

@ -5,7 +5,15 @@
static bool subWifiListSort(const KyWirelessNetItem info1, const KyWirelessNetItem info2)
{
if (info1.m_isConfigured == info2.m_isConfigured) {
return info1.m_signalStrength >info2.m_signalStrength;
if (info1.m_signalStrength != info2.m_signalStrength) {
return info1.m_signalStrength >info2.m_signalStrength;
} else {
if (QString::compare(info1.m_NetSsid, info2.m_NetSsid, Qt::CaseInsensitive) > 0) {
return false;
} else {
return true;
}
}
}
return info1.m_isConfigured;
}

View File

@ -1287,6 +1287,7 @@ void WlanPage::onMainWindowVisibleChanged(const bool &visible)
//打开页面时先触发一次扫描然后定时扫描wifi热点和刷新icon
requestScan();
m_scanTimer->start(AP_SCAN_INTERVAL);
onRefreshIconTimer();
// m_refreshIconTimer->start(ICON_REFRESH_INTERVAL);
} else {
//界面关闭的时候停止wifi扫描和刷新