Fix active AP (#21511)

* Revert "Qt logging through cloudlog (#21452)"

This reverts commit 54b6a9f121.

* set activeAp after scan so it's not blocking

* Revert "Revert "Qt logging through cloudlog (#21452)""

This reverts commit d9689a55057d53f7afe8e2ea28542eb80175a705.

* clean up

* move to another PR
This commit is contained in:
sshane
2021-07-07 21:48:46 -07:00
committed by GitHub
parent b7f8c6ad03
commit 648639787c
2 changed files with 12 additions and 0 deletions
+11
View File
@@ -335,6 +335,7 @@ 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;
@@ -449,6 +450,16 @@ void WifiManager::setTetheringEnabled(bool enabled) {
}
}
QString WifiManager::getActiveAp() {
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();
}
bool WifiManager::isTetheringEnabled() {
if (activeAp != "" && activeAp != "/") {
return get_property(activeAp, "Ssid") == tethering_ssid;
+1
View File
@@ -70,6 +70,7 @@ private:
QList<Network> get_networks();
void connect(const QByteArray &ssid, const QString &username, const QString &password, SecurityType security_type);
QString activeAp;
QString getActiveAp();
void deactivateConnection(const QString &ssid);
QVector<QDBusObjectPath> get_active_connections();
uint get_wifi_device_state();