@ -69,11 +69,15 @@ void WifiManager::setup() {
QDBusMessage response = device_props . call ( " Get " , NM_DBUS_INTERFACE_DEVICE , " State " ) ;
raw_adapter_state = get_response < uint > ( response ) ;
initActiveAp ( ) ;
initConnections ( ) ;
requestScan ( ) ;
}
void WifiManager : : refreshNetworks ( ) {
if ( adapter . isEmpty ( ) ) {
return ;
}
seen_networks . clear ( ) ;
seen_ssids . clear ( ) ;
ipv4_address = get_ipv4_address ( ) ;
@ -316,7 +320,6 @@ void WifiManager::stateChange(unsigned int new_state, unsigned int previous_stat
void WifiManager : : propertyChange ( const QString & interface , const QVariantMap & props , const QStringList & invalidated_props ) {
if ( interface = = NM_DBUS_INTERFACE_DEVICE_WIRELESS & & props . contains ( " LastScan " ) ) {
if ( this - > isVisible ( ) | | firstScan ) {
activeAp = getActiveAp ( ) ;
refreshNetworks ( ) ;
emit refreshSignal ( ) ;
firstScan = false ;
@ -431,13 +434,12 @@ void WifiManager::setTetheringEnabled(bool enabled) {
}
}
QString WifiManager : : ge tActiveAp( ) {
void WifiManager : : ini tActiveAp( ) {
QDBusInterface device_props ( NM_DBUS_SERVICE , adapter , NM_DBUS_INTERFACE_PROPERTIES , bus ) ;
device_props . setTimeout ( DBUS_TIMEOUT ) ;
QDBusMessage response = device_props . call ( " Get " , NM_DBUS_INTERFACE_DEVICE_WIRELESS , " ActiveAccessPoint " ) ;
QDBusObjectPath r = get_response < QDBusObjectPath > ( response ) ;
return r . path ( ) ;
const QDBusMessage & response = device_props . call ( " Get " , NM_DBUS_INTERFACE_DEVICE_WIRELESS , " ActiveAccessPoint " ) ;
activeAp = get_response < QDBusObjectPath > ( response ) . path ( ) ;
}