Skip to content

Commit 0fa59e7

Browse files
committed
fix: set single shot for wifi OSD delay timer
Set m_delayShowWifiOSD timer as single shot to ensure it only triggers once after timeout This prevents the timer from firing repeatedly and causing multiple OSD popups The timer is used to delay showing WiFi OSD and should only execute its slot once Log: Fixed WiFi OSD potentially showing multiple times due to timer configuration Influence: 1. Test WiFi connection process to verify OSD appears only once 2. Check timer behavior when network state changes rapidly 3. Verify OSD display timing matches expected delay 4. Test under various network connection scenarios fix: 设置 WiFi OSD 延迟定时器为单次触发 将 m_delayShowWifiOSD 定时器设置为单次触发,确保超时后只触发一次 防止定时器重复触发导致多个 OSD 弹窗出现 该定时器用于延迟显示 WiFi OSD,应只执行其槽函数一次 Log: 修复因定时器配置问题可能导致 WiFi OSD 多次显示的问题 Influence: 1. 测试 WiFi 连接过程,验证 OSD 只出现一次 2. 检查网络状态快速变化时的定时器行为 3. 验证 OSD 显示时间是否符合预期延迟 4. 在不同网络连接场景下进行测试 PMS: BUG-340961
1 parent 2d9d0cc commit 0fa59e7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

network-service-plugin/src/session/networkstatehandler.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ NetworkStateHandler::NetworkStateHandler(QObject *parent)
6363
, m_delayShowWifiOSD(new QTimer(this))
6464
, m_resetWifiOSDEnableTimer(new QTimer(this))
6565
{
66+
m_delayShowWifiOSD->setSingleShot(true);
67+
m_resetWifiOSDEnableTimer->setSingleShot(true);
6668
connect(m_dbusService, &QDBusServiceWatcher::serviceRegistered, this, &NetworkStateHandler::init);
6769
connect(m_delayShowWifiOSD, &QTimer::timeout, this, &NetworkStateHandler::delayShowWifiOSD);
6870
connect(m_resetWifiOSDEnableTimer, &QTimer::timeout, this, &NetworkStateHandler::resetWifiOSDEnable);
@@ -744,7 +746,7 @@ void NetworkStateHandler::delayShowWifiOSD()
744746

745747
void NetworkStateHandler::updateOSDTimer(int interval)
746748
{
747-
if (interval < 60) { // 确保interval不会导致负数
749+
if (interval < 60) { // 确保interval不会导致负数
748750
interval = 60;
749751
}
750752
m_delayShowWifiOSD->setInterval(interval - 50);

0 commit comments

Comments
 (0)