forked from qt-creator/qt-creator
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:
@@ -365,6 +365,7 @@ void TestCodeParser::onTaskStarted(Core::Id type)
|
|||||||
m_fullUpdatePostponed = m_parserState == FullParse;
|
m_fullUpdatePostponed = m_parserState == FullParse;
|
||||||
m_partialUpdatePostponed = !m_fullUpdatePostponed;
|
m_partialUpdatePostponed = !m_fullUpdatePostponed;
|
||||||
qCDebug(LOG) << "Canceling scan for test (CppModelParsing started)";
|
qCDebug(LOG) << "Canceling scan for test (CppModelParsing started)";
|
||||||
|
parsingHasFailed = true;
|
||||||
Core::ProgressManager::instance()->cancelTasks(Constants::TASK_PARSE);
|
Core::ProgressManager::instance()->cancelTasks(Constants::TASK_PARSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -372,6 +373,10 @@ void TestCodeParser::onTaskStarted(Core::Id type)
|
|||||||
|
|
||||||
void TestCodeParser::onAllTasksFinished(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
|
// only CPP parsing is relevant as we trigger Qml parsing internally anyway
|
||||||
if (type != CppTools::Constants::TASK_INDEX)
|
if (type != CppTools::Constants::TASK_INDEX)
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user