diff --git a/src/kylin-dbus-interface.cpp b/src/kylin-dbus-interface.cpp index a5a6e8a5..c0688c1b 100644 --- a/src/kylin-dbus-interface.cpp +++ b/src/kylin-dbus-interface.cpp @@ -1629,8 +1629,8 @@ void KylinDBus::onPropertiesChanged(QVariantMap qvm) //接收到自动连接的信号过后执行自动连接wifi void KylinDBus::onAutoConnect() { - syslog(LOG_DEBUG, "Receive a auto-connect signal to reconnect network"); - qDebug() << "Receive a auto-connect signal to reconnect network"; + syslog(LOG_DEBUG, "Receive a auto-connect signal to reconnect wifi"); + qDebug() << "Receive a auto-connect signal to reconnect wifi"; mw->toReconnectWifi(); } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index c5bb0a65..fadf8ab2 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3168,18 +3168,20 @@ void MainWindow::on_btnHotspotState() //执行wifi的重新连接 void MainWindow::toReconnectWifi() { - if (canReconnectNetwork) { - canReconnectNetwork = false; - if (!is_stop_check_net_state && isHuaWeiPC) { + if (canReconnectWifiTimeInterval) { + canReconnectWifiTimeInterval = false; + QTimer::singleShot(2*1000, this, SLOT(timeIntervalToConnectWifi() )); + + if (isHuaWeiPC) { current_wifi_list_state = RECONNECT_WIFI; this->ksnm->execGetWifiList(this->wcardname); } } } -void MainWindow::toChangeReconnectValue() +void MainWindow::timeIntervalToConnectWifi() { - canReconnectNetwork = true; + canReconnectWifiTimeInterval = true; } //处理外界对网络的连接与断开 diff --git a/src/mainwindow.h b/src/mainwindow.h index 4fc7ce98..199a8661 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -183,7 +183,7 @@ public: bool isReconnectingLan = false; //是否正在执行lan的回连 int addNumberForWifi = 0; //短时间内收到关于wifi连接信号的次数 bool isHuaWeiPC; - bool canReconnectNetwork = true; + bool canReconnectWifiTimeInterval = true; QString currSelNetName = ""; //当前ScrollArea中选中的网络名称 QStringList canReconnectWifiList; //当前可以回连的wifi列表 @@ -234,7 +234,7 @@ public slots: void checkIfConnectedWifiExist(); void toReconnectWifi(); - void toChangeReconnectValue(); + void timeIntervalToConnectWifi(); void rfkillDisableWifiDone(); void rfkillEnableWifiDone();