AutoTest: Fix stopping progress animation on cancel

Sometimes the progress indicator did not stop its animation
when parsing for tests was canceled.

Change-Id: I0e4896f2b391ce6690d079fb8b33972cc5fb07f3
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2016-09-27 09:32:48 +02:00
parent 2431b7f4a2
commit e9869abfd5

View File

@@ -365,6 +365,7 @@ void TestCodeParser::onTaskStarted(Core::Id type)
m_fullUpdatePostponed = m_parserState == FullParse;
m_partialUpdatePostponed = !m_fullUpdatePostponed;
qCDebug(LOG) << "Canceling scan for test (CppModelParsing started)";
parsingHasFailed = true;
Core::ProgressManager::instance()->cancelTasks(Constants::TASK_PARSE);
}
}
@@ -372,6 +373,10 @@ void TestCodeParser::onTaskStarted(Core::Id type)
void TestCodeParser::onAllTasksFinished(Core::Id type)
{
// if we cancel parsing ensure that progress animation is canceled as well
if (type == Constants::TASK_PARSE && parsingHasFailed)
emit parsingFailed();
// only CPP parsing is relevant as we trigger Qml parsing internally anyway
if (type != CppTools::Constants::TASK_INDEX)
return;