mirror of
https://github.com/Quill-OS/quill.git
synced 2024-12-27 16:17:21 -08:00
fix for only one network scanned and for closing wifi logger
This commit is contained in:
parent
4bb87485e0
commit
f21857fad9
3 changed files with 22 additions and 17 deletions
|
@ -252,21 +252,24 @@ void wifiDialog::refreshNetworksList() {
|
||||||
QVector<global::wifi::wifiNetworkData> sortedPureNetworkList;
|
QVector<global::wifi::wifiNetworkData> sortedPureNetworkList;
|
||||||
sortedPureNetworkList.append(pureNetworkList.first());
|
sortedPureNetworkList.append(pureNetworkList.first());
|
||||||
pureNetworkList.removeFirst();
|
pureNetworkList.removeFirst();
|
||||||
for(global::wifi::wifiNetworkData wifiNetwork: pureNetworkList) {
|
// Possible fix for a segment fault
|
||||||
bool stopIterating = false;
|
if(pureNetworkList.isEmpty() == false) {
|
||||||
int counter = 0;
|
for(global::wifi::wifiNetworkData wifiNetwork: pureNetworkList) {
|
||||||
for(global::wifi::wifiNetworkData wifiNetworkToSort: sortedPureNetworkList) {
|
bool stopIterating = false;
|
||||||
if(stopIterating == false) {
|
int counter = 0;
|
||||||
if(wifiNetwork.signal >= wifiNetworkToSort.signal) {
|
for(global::wifi::wifiNetworkData wifiNetworkToSort: sortedPureNetworkList) {
|
||||||
sortedPureNetworkList.insert(counter, wifiNetwork);
|
if(stopIterating == false) {
|
||||||
stopIterating = true;
|
if(wifiNetwork.signal >= wifiNetworkToSort.signal) {
|
||||||
|
sortedPureNetworkList.insert(counter, wifiNetwork);
|
||||||
|
stopIterating = true;
|
||||||
|
}
|
||||||
|
counter = counter + 1;
|
||||||
}
|
}
|
||||||
counter = counter + 1;
|
|
||||||
}
|
}
|
||||||
}
|
// This happens if it's the smallest value, so insert it at the end
|
||||||
// This happens if it's the smallest value, so insert it at the end
|
if(stopIterating == false) {
|
||||||
if(stopIterating == false) {
|
sortedPureNetworkList.append(wifiNetwork);
|
||||||
sortedPureNetworkList.append(wifiNetwork);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log("There are " + QString::number(sortedPureNetworkList.count()) + " sorted networks", className);
|
log("There are " + QString::number(sortedPureNetworkList.count()) + " sorted networks", className);
|
||||||
|
@ -438,7 +441,8 @@ void wifiDialog::watcher() {
|
||||||
bool time = checkProcessName("smarter_time_sync.sh");
|
bool time = checkProcessName("smarter_time_sync.sh");
|
||||||
if(time == true) {
|
if(time == true) {
|
||||||
forceRefresh = true;
|
forceRefresh = true;
|
||||||
setStatusText("Syncing");
|
// Please leave it as "Syncting time" because many people will complain about innacurate time. This info will answer them
|
||||||
|
setStatusText("Syncing time");
|
||||||
QTimer::singleShot(relaunchMs, this, SLOT(watcher()));
|
QTimer::singleShot(relaunchMs, this, SLOT(watcher()));
|
||||||
return void();
|
return void();
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,7 @@ wifilogger::~wifilogger()
|
||||||
|
|
||||||
void wifilogger::setWifiInfoPage() {
|
void wifilogger::setWifiInfoPage() {
|
||||||
if(checkWifiState() == global::wifi::wifiState::configured) {
|
if(checkWifiState() == global::wifi::wifiState::configured) {
|
||||||
QTimer::singleShot(0, this, SLOT(getWifiInformation()));
|
getWifiInformationTimer.singleShot(0, this, SLOT(getWifiInformation()));
|
||||||
ui->stackedWidget->setCurrentIndex(0);
|
ui->stackedWidget->setCurrentIndex(0);
|
||||||
ui->nameLabel->setText("Network information");
|
ui->nameLabel->setText("Network information");
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,6 @@ void wifilogger::getWifiInformation() {
|
||||||
QFile wifiInformationPath = QFile("/external_root/run/wifi_information");
|
QFile wifiInformationPath = QFile("/external_root/run/wifi_information");
|
||||||
if(waitingForFile == false) {
|
if(waitingForFile == false) {
|
||||||
wifiInformationPath.remove();
|
wifiInformationPath.remove();
|
||||||
|
|
||||||
log("Sending get_wifi_information ibxd call", className);
|
log("Sending get_wifi_information ibxd call", className);
|
||||||
string_writeconfig("/opt/ibxd", "get_wifi_information\n");
|
string_writeconfig("/opt/ibxd", "get_wifi_information\n");
|
||||||
waitingForFile = true;
|
waitingForFile = true;
|
||||||
|
@ -136,7 +135,7 @@ void wifilogger::getWifiInformation() {
|
||||||
|
|
||||||
if(waitingForFile == true) {
|
if(waitingForFile == true) {
|
||||||
if(wifiInformationPath.exists() == false) {
|
if(wifiInformationPath.exists() == false) {
|
||||||
QTimer::singleShot(1000, this, SLOT(getWifiInformation()));
|
getWifiInformationTimer.singleShot(1000, this, SLOT(getWifiInformation()));
|
||||||
return void();
|
return void();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -179,6 +178,7 @@ void wifilogger::getWifiInformation() {
|
||||||
void wifilogger::on_returnBtn_clicked()
|
void wifilogger::on_returnBtn_clicked()
|
||||||
{
|
{
|
||||||
log("Exiting wifilogger", className);
|
log("Exiting wifilogger", className);
|
||||||
|
getWifiInformationTimer.stop();
|
||||||
this->deleteLater();
|
this->deleteLater();
|
||||||
this->close();
|
this->close();
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,7 @@ private:
|
||||||
QFile fancyLogs = QFile("/external_root/run/wifi_stats");
|
QFile fancyLogs = QFile("/external_root/run/wifi_stats");
|
||||||
QFile allLogs = QFile("/external_root/var/log/wifi.log");
|
QFile allLogs = QFile("/external_root/var/log/wifi.log");
|
||||||
bool waitingForFile = false;
|
bool waitingForFile = false;
|
||||||
|
QTimer getWifiInformationTimer;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void setWifiInfoPage();
|
void setWifiInfoPage();
|
||||||
|
|
Loading…
Reference in a new issue