From 07ecbead246572f41310e960c241167e5dbe6b2f Mon Sep 17 00:00:00 2001 From: chenlelin Date: Tue, 5 Jan 2021 11:24:25 +0800 Subject: [PATCH] Fix bug wifi switch not change when input 'rfkill block all' by comand line --- src/mainwindow.cpp | 39 ++------------------------------------- 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 3eadfd68..16ccb90f 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -424,13 +424,6 @@ void MainWindow::getInitLanSlist() } } - qDebug() << " "; - foreach (QString sss, oldLanSlist) { - qDebug() << "AAAAA the oldLanSlist is:"<hide(); btnAddNet->hide(); @@ -1201,7 +1193,6 @@ void MainWindow::onBtnWifiClicked(int flag) disWifiStateKeep(); } - } void MainWindow::onBtnNetListClicked(int flag) @@ -1370,29 +1361,17 @@ void MainWindow::on_btnWifiList_clicked() // 获取lan列表回调 void MainWindow::getLanListDone(QStringList slist) { - qDebug() << " "; - qDebug() <ksnm->isUseOldLanSlist) { slist = oldLanSlist; this->ksnm->isUseOldLanSlist = false; } - syslog(LOG_DEBUG, "AAAAAAAAAAAAAAAAAAAAAAA"); //若slist为空,则也使用上一次获取到的列表 if (slist.size() == 1 && slist.at(0) == "") { if (oldLanSlist.size() == 1 && oldLanSlist.at(0) == "") { - syslog(LOG_DEBUG, "AAAAAAAAAAAAAAAAAAAAAAB"); return; } else { - syslog(LOG_DEBUG, "AAAAAAAAAAAAAAAAAAAAAAC"); slist = oldLanSlist; } } @@ -1413,7 +1392,6 @@ void MainWindow::getLanListDone(QStringList slist) // 若当前lan name为"--",设置OneConnForm if (currConnNames.size() == 0) { - syslog(LOG_DEBUG, "AAAAAAAAAAAAAAAAAAAAAAD"); OneLancForm *ccf = new OneLancForm(topLanListWidget, this, confForm, ksnm); ccf->setName(tr("Not connected"), "--", "--");//"当前未连接任何 以太网" ccf->setIcon(false); @@ -1431,24 +1409,13 @@ void MainWindow::getLanListDone(QStringList slist) ccf->setLine(false); currTopLanItem = 1; } else { - syslog(LOG_DEBUG, "AAAAAAAAAAAAAAAAAAAAAAE"); int i = 0; do { - syslog(LOG_DEBUG, "AAAAAAAAAAAAAAAAAAAAAAF"); actLanSsidName.append(currConnNames.at(i)); //网络名称 actLanUuidName.append(currConnNames.at(i+1)); //网络唯一ID i += 2; } while(iresize(topLanListWidget->width(), topLanListWidget->height() + H_NORMAL_ITEM*kk); isActiveNet = true; //名为nname的网络是已经连接的有线网络 ifLanConnected = true; @@ -2636,10 +2599,12 @@ void MainWindow::onExternalWifiSwitchChange(bool wifiEnabled) qDebug()<<"debug: external wifi switch turn on"; syslog(LOG_DEBUG, "debug: external wifi switch turn on"); QTimer::singleShot(4*1000, this, SLOT(onExternalWifiChange() )); + objKyDBus->setWifiSwitchState(true); } else { qDebug()<<"debug: external wifi switch turn off"; syslog(LOG_DEBUG, "debug: external wifi switch turn off"); QTimer::singleShot(3*1000, this, SLOT(onExternalWifiChange() )); + objKyDBus->setWifiSwitchState(false); } } }