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: