AutoTest: Fix handling of enabled state for code parser

Avoid unintentional re-enabling of the code parser.
Handling of the enabled state broke several times before,
therefore separate it from other states of the parser to
avoid breaking it again when not taking enough care while
refactoring or adding features related to states.

Change-Id: If1eb0dd649225f10bfc3bf06f09851649da75983
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2016-11-08 16:00:21 +01:00
parent b5f587efb5
commit f967545c5a
5 changed files with 18 additions and 22 deletions

View File

@@ -115,7 +115,7 @@ TestNavigationWidget::~TestNavigationWidget()
void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event)
{
const bool enabled = !TestRunner::instance()->isTestRunning()
&& m_model->parser()->state() == TestCodeParser::Idle;
&& m_model->parser()->enabled() && m_model->parser()->state() == TestCodeParser::Idle;
const bool hasTests = m_model->hasTests();
QMenu menu;