diff options
-rw-r--r-- | plugins/autotest/testcodeparser.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/autotest/testcodeparser.cpp b/plugins/autotest/testcodeparser.cpp index 2ffe2a137e..df147835a5 100644 --- a/plugins/autotest/testcodeparser.cpp +++ b/plugins/autotest/testcodeparser.cpp @@ -87,6 +87,9 @@ ProjectExplorer::Project *currentProject() void TestCodeParser::setState(State state) { m_parserState = state; + // avoid triggering parse before code model parsing has finished + if (!m_parserEnabled) + return; if (m_parserState == Disabled) { m_fullUpdatePostponed = m_partialUpdatePostponed = false; m_postponedFiles.clear(); @@ -727,6 +730,9 @@ void TestCodeParser::onAllTasksFinished(Core::Id type) if (type != CppTools::Constants::TASK_INDEX) return; m_parserEnabled = true; + // avoid illegal parser state if respective widgets became hidden while parsing + if (m_parserState == Disabled) + m_parserState = Idle; if (m_fullUpdatePostponed) updateTestTree(); else if (m_partialUpdatePostponed) { @@ -888,6 +894,9 @@ void TestCodeParser::onProFileEvaluated() QStringList files; foreach (auto projectFile, p->files) files.append(projectFile.path); + // avoid illegal parser state when respective widgets became hidden while evaluating + if (m_parserState == Disabled) + m_parserState = Idle; scanForTests(files); } } |