@ -99,15 +99,22 @@ void WifiManager::refreshFinished(QDBusPendingCallWatcher *watcher) {
auto properties = replay . value ( ) ;
auto properties = replay . value ( ) ;
const QByteArray ssid = properties [ " Ssid " ] . toByteArray ( ) ;
const QByteArray ssid = properties [ " Ssid " ] . toByteArray ( ) ;
uint32_t strength = properties [ " Strength " ] . toUInt ( ) ;
if ( ssid . isEmpty ( ) ) continue ;
if ( ssid . isEmpty ( ) | | ( seenNetworks . contains ( ssid ) & & strength < = seenNetworks [ ssid ] . strength ) ) continue ;
// May be multiple access points for each SSID.
// Use first for ssid and security type, then update connected status and strength using all
if ( ! seenNetworks . contains ( ssid ) ) {
seenNetworks [ ssid ] = { ssid , 0U , ConnectedType : : DISCONNECTED , getSecurityType ( properties ) } ;
}
SecurityType security = getSecurityType ( properties ) ;
ConnectedType ctype = ConnectedType : : DISCONNECTED ;
if ( path . path ( ) = = activeAp ) {
if ( path . path ( ) = = activeAp ) {
ctype = ( ssid = = connecting_to_network ) ? ConnectedType : : CONNECTING : ConnectedType : : CONNECTED ;
seenNetworks [ ssid ] . connected = ( ssid = = connecting_to_network ) ? ConnectedType : : CONNECTING : ConnectedType : : CONNECTED ;
}
uint32_t strength = properties [ " Strength " ] . toUInt ( ) ;
if ( seenNetworks [ ssid ] . strength < strength ) {
seenNetworks [ ssid ] . strength = strength ;
}
}
seenNetworks [ ssid ] = { ssid , strength , ctype , security } ;
}
}
emit refreshSignal ( ) ;
emit refreshSignal ( ) ;