From c4c509c730a07bdc15388915daebca038a42f60f Mon Sep 17 00:00:00 2001 From: zhangjiaping Date: Tue, 12 Jan 2021 17:11:03 +0800 Subject: [PATCH] fix(active wifi): Activate wifi is empty when there is space in wifi name. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description: 修复wifi名称含有空格时不显示激活wifi的bug Log: 修复wifi名称含有空格时不显示激活wifi的bug --- src/mainwindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 52dbddd5..98678a9b 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1645,7 +1645,10 @@ void MainWindow::loadWifiListDone(QStringList slist) }); connect(process, &QProcess::readyReadStandardOutput, this, [ = ]() { QString str = process->readAllStandardOutput(); - actWifissid = str.mid(str.lastIndexOf(" ") + 1, str.length() - str.lastIndexOf(" ") - 2); + actWifissid = str.mid(str.lastIndexOf(" ") + 1, str.length() - str.lastIndexOf(" ") - 2); //获取到ssid时,以ssid为准 + }); + connect(process, &QProcess::readyReadStandardError, this, [ = ]() { + actWifissid = actWifiName; //没有获取到ssid时,以wifi名为准 }); process->waitForFinished(); }