From dc21bd6af2fd736256856dcf100cc98f0a5f4ab8 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 27 Feb 2024 14:44:40 +0100 Subject: [PATCH] AutoTest: Delay reparsing of postponed files Task-number: QTCREATORBUG-30447 Change-Id: Ica1dba358e05edfe2ad7ed6fd92fc8afde291718 Reviewed-by: Christian Kandeler Reviewed-by: David Schulz --- src/plugins/autotest/testcodeparser.cpp | 26 +++++-------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/src/plugins/autotest/testcodeparser.cpp b/src/plugins/autotest/testcodeparser.cpp index 1824b316d59..9e46232c5bc 100644 --- a/src/plugins/autotest/testcodeparser.cpp +++ b/src/plugins/autotest/testcodeparser.cpp @@ -55,6 +55,7 @@ TestCodeParser::TestCodeParser() m_qmlEditorRev.remove(filePath); }); m_reparseTimer.setSingleShot(true); + m_reparseTimer.setInterval(1000); connect(&m_reparseTimer, &QTimer::timeout, this, &TestCodeParser::parsePostponedFiles); connect(&m_taskTreeRunner, &TaskTreeRunner::aboutToStart, this, [this](TaskTree *taskTree) { if (m_withTaskProgress) { @@ -238,27 +239,10 @@ bool TestCodeParser::postponed(const QSet &filePaths) if (filePaths.size() == 1) { if (m_reparseTimerTimedOut) return false; - const FilePath filePath = *filePaths.begin(); - switch (m_postponedFiles.size()) { - case 0: - m_postponedFiles.insert(filePath); - m_reparseTimer.setInterval(1000); - m_reparseTimer.start(); - return true; - case 1: - if (m_postponedFiles.contains(filePath)) { - m_reparseTimer.start(); - return true; - } - Q_FALLTHROUGH(); - default: - m_postponedFiles.insert(filePath); - m_reparseTimer.stop(); - m_reparseTimer.setInterval(0); - m_reparseTimerTimedOut = false; - m_reparseTimer.start(); - return true; - } + + m_postponedFiles.insert(*filePaths.begin()); + m_reparseTimer.start(); + return true; } return false; case PartialParse: