From 6c2e40b94dc4221b69241df336a24f6a832612fc Mon Sep 17 00:00:00 2001 From: chenlelin Date: Tue, 22 Jun 2021 21:09:47 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20bug-61628=20wifi=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E5=AF=86=E7=A0=81=E8=BF=9E=E6=8E=A5=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E5=90=8E=EF=BC=8C=E5=88=A0=E9=99=A4=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E8=BE=93=E5=85=A5=E5=90=8E=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=97=A0=E5=8F=8D=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.cpp | 2 +- src/mainwindow.cpp | 7 ++++++- src/oneconnform.cpp | 1 + src/onelancform.cpp | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 8759f993..c53cb619 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -81,7 +81,7 @@ int main(int argc, char *argv[]) QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); QApplication a(argc, argv); - qInstallMessageHandler(messageOutput); + //qInstallMessageHandler(messageOutput); qDebug()<<"Kylin Network Manager Is Already Launched"; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 7a98e83c..653ae685 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2106,8 +2106,12 @@ void MainWindow::getConnListDone(QStringList slist) if (! is_stop_check_net_state) { this->is_stop_check_net_state = 1; BackThread *bt = new BackThread(); +// connect(bt, SIGNAL(connDone(int)), this, SLOT(connWifiDone(int))); + connect(bt, &BackThread::connDone, this, [ = ](int res) { + connWifiDone(res); + bt->deleteLater(); + }); bt->execConnWifi(lastAddedConn, objKyDBus->dbusWiFiCardName); - connect(bt, SIGNAL(connDone(int)), this, SLOT(connWifiDone(int))); } } oldConnSlist.clear(); @@ -3966,6 +3970,7 @@ void MainWindow::onExternalWifiChange() // //objKyDBus->showDesktopNotify(txt); // } if (m_connected_by_self) { + is_stop_check_net_state = 0; m_connected_by_self = false; return; } diff --git a/src/oneconnform.cpp b/src/oneconnform.cpp index a8b82acc..07f0508d 100644 --- a/src/oneconnform.cpp +++ b/src/oneconnform.cpp @@ -896,6 +896,7 @@ void OneConnForm::on_btnConnPWD_clicked() passwdFile->close(); // cmdStr = "nmcli connection up " + wifiName + " passwd-file " + homePath +"/.config/" + wifiName + ".psk"; } + mw->is_stop_check_net_state = 1; QThread *t = new QThread(); BackThread *bt = new BackThread(); diff --git a/src/onelancform.cpp b/src/onelancform.cpp index e9943e8a..16fd1403 100644 --- a/src/onelancform.cpp +++ b/src/onelancform.cpp @@ -398,6 +398,7 @@ void OneLancForm::toConnectWiredNetwork() if (mw->is_stop_check_net_state == 1) { return; } + mw->is_stop_check_net_state = 1; QThread *t = new QThread(); BackThread *bt = new BackThread();