From a64d74ca16b9ade7a8c3e52fb03c05d104c2fc4e Mon Sep 17 00:00:00 2001 From: chenlelin Date: Fri, 30 Apr 2021 08:52:55 +0800 Subject: [PATCH] Refresh wifi interface delay 1 second --- src/kylin-dbus-interface.cpp | 2 +- src/mainwindow.cpp | 13 ++----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/kylin-dbus-interface.cpp b/src/kylin-dbus-interface.cpp index 633b63d5..8c682841 100644 --- a/src/kylin-dbus-interface.cpp +++ b/src/kylin-dbus-interface.cpp @@ -1712,7 +1712,7 @@ void KylinDBus::onPropertiesChanged(QVariantMap qvm) void KylinDBus::onAutoConnect() { syslog(LOG_DEBUG, "Receive a auto-connect signal to reconnect wifi"); - qDebug() << "Receive a auto-connect signal to reconnect wifi"; + qDebug() << Q_FUNC_INFO << "Receive a auto-connect signal to reconnect wifi"; mw->toReconnectWifi(); } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index b87ec938..5f21d857 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -933,7 +933,7 @@ void MainWindow::getActiveInfoAndSetTrayIcon() // 设置图标 if (actLanName != "--") { QList lanstate = objKyDBus->getAtiveLanSsidUuidState(); - qDebug() << Q_FUNC_INFO << lanstate; + //qDebug() << Q_FUNC_INFO << lanstate; if (lanstate[2] == "connected") { setTrayIcon(iconLanOnline); } @@ -3267,15 +3267,6 @@ void MainWindow::onExternalConnectionChange(QString type, bool isConnUp) isReconnectingWifi = false; if ( (type == "802-11-wireless" || type == "wifi") && !isConnUp ){ - //如果是手动点击断开连接,因为还在处理中,所以is_stop_check_net_state的值为true, - //这样对于点击手动断开连接后立马发出的断开连接信号,便不会做处理 -// if (!is_stop_check_net_state) { -// if (canReconnectWifiList.size() >= 1) { -// int removePos = canReconnectWifiList.size() - 1; -// //从列表中移除最后一个wifi,因为可能有外界因素导致wifi断开连接 -// canReconnectWifiList.removeAt(removePos); -// } -// } QTimer::singleShot(2*1000, this, SLOT(onToResetValue() )); } if (type == "802-11-wireless" || type == "wifi") { @@ -3294,7 +3285,7 @@ void MainWindow::onExternalConnectionChange(QString type, bool isConnUp) is_wifi_reconnected = 0; is_stop_check_net_state = 0; }else { - QTimer::singleShot(1*1000, this, SLOT(onExternalWifiChange() )); + QTimer::singleShot(2*1000, this, SLOT(onExternalWifiChange() )); } addNumberForWifi = 0; return;