diff --git a/src/backthread.cpp b/src/backthread.cpp index eaeeda05..b61a622b 100644 --- a/src/backthread.cpp +++ b/src/backthread.cpp @@ -85,7 +85,6 @@ IFace* BackThread::execGetIface() // if type is wired network iface->lname = iname; - qDebug() << "有线网的状态是 "<lstate = 2; //switch of wired device is off } else if (istateStr == "disconnected" || istateStr == "unavailable") { diff --git a/src/kylin-dbus-interface.cpp b/src/kylin-dbus-interface.cpp index 05c76e18..93e3578f 100644 --- a/src/kylin-dbus-interface.cpp +++ b/src/kylin-dbus-interface.cpp @@ -344,9 +344,8 @@ void KylinDBus::getLanIpDNS(QString uuidName, bool isActNet) dbusArg2nd.beginArray(); while (!dbusArg2nd.atEnd()) { dbusArg2nd >> strDns;// append map to a vector here if you want to keep it - // 当获取到dns时,dns肯定不会为0,所以就会有一个类似出栈的操作,就会走到atEnd尾部; - // 当获取到的dns为空时,就没有类似的出栈操作,获取到的数字就有问题; if (strDns == 0) { + //dbusArg2nd为空时,strDns没有从dbusArg2nd获取到结果 dbusArg2nd.endArray(); } } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 85540c67..d6375e57 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1482,11 +1482,11 @@ void MainWindow::getLanListDone(QStringList slist) } else { ccfAct->setLine(false); //最后一个item不显示下划线 } - - if (!objKyDBus->dbusLanIpv4.isEmpty()) { +\ + if (!objKyDBus->dbusLanIpv4.isEmpty() && !objKyDBus->dbusActiveLanIpv4.isEmpty()) { if (objKyDBus->dbusActiveLanIpv4 != objKyDBus->dbusLanIpv4) { //在第三方nm-connection-editor进行新的IP配置后,重新连接网络 - //objKyDBus->connectWiredNet(nname); + objKyDBus->connectWiredNet(nname); } else if ((oldActLanName == actLanSsidName.at(kk)) && (oldDbusActLanDNS != objKyDBus->dbusActLanDNS)) { //在第三方nm-connection-editor进行新的DNS配置后,重新连接网络 objKyDBus->connectWiredNet(nname);