summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@theqtcompany.com>2015-03-30 10:44:54 +0200
committerChristian Stenger <christian.stenger@theqtcompany.com>2015-03-30 12:21:44 +0300
commit377408b1b05df5dbc9ed9584408ac9750a81fb33 (patch)
tree3278f571a7b576cb6bf5cb0c743f4650c6abaa77
parentd0de2fdbbc10a916567e1fc332f307e64f18e306 (diff)
downloadqt-creator-377408b1b05df5dbc9ed9584408ac9750a81fb33.tar.gz
Fix parser state handling...
...especially state transitions that may happen while project files are evaluated or source files are parsed. Change-Id: Iceef38500b6d6a4deb430738e5e960077f8eb39a Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
-rw-r--r--plugins/autotest/testcodeparser.cpp9
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);
}
}