Fix Wi-Fi interface bug when no networks are found

This commit is contained in:
Nicolas Mailloux 2022-04-18 14:29:54 -04:00
parent 5838ff1833
commit 8ad06262e9
2 changed files with 5 additions and 4 deletions

View file

@ -83,8 +83,7 @@ void toast::exitSlot(int exitCode) {
toast::close();
}
else {
ui->messageLabel->setText("No networks found");
QTimer::singleShot(global::toast::delay, this, SLOT(close()));
emit showToast("No networks found");
}
}

View file

@ -52,12 +52,14 @@ void wifiDialog::checkWifiNetworks() {
}
void wifiDialog::printWifiNetworks() {
string_checkconfig_ro("/run/wifi_networks_list");
if(checkconfig_str_val == "") {
if(readFile("/run/wifi_networks_list").isEmpty()) {
log("Wi-Fi networks list empty", className);
QFile::remove("/run/wifi_networks_list");
emit quit(1);
wifiDialog::close();
}
else {
log("Parsing Wi-Fi networks list", className);
QFile wifiNetworksListFile("/run/wifi_networks_list");
wifiNetworksListFile.open(QIODevice::ReadWrite);
QTextStream in (&wifiNetworksListFile);