forked from qt-creator/qt-creator
AutoTest: Fix enabling run buttons
If a parsing for tests is in progress the buttons might get enabled but they should be disabled until the parsing has finished. Change-Id: I3f089626983c219a9b54d8fc057a7ff51f11dc8c Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
@@ -62,6 +62,7 @@ public:
|
||||
virtual ~TestCodeParser();
|
||||
void setState(State state);
|
||||
State state() const { return m_parserState; }
|
||||
bool isParsing() const { return m_parserState == PartialParse || m_parserState == FullParse; }
|
||||
void setDirty() { m_dirty = true; }
|
||||
#ifdef WITH_TESTS
|
||||
bool furtherParsingExpected() const
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "testrunner.h"
|
||||
#include "testsettings.h"
|
||||
#include "testtreemodel.h"
|
||||
#include "testcodeparser.h"
|
||||
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/coreicons.h>
|
||||
@@ -517,7 +518,8 @@ void TestResultsPane::onScrollBarRangeChanged(int, int max)
|
||||
void TestResultsPane::updateRunActions()
|
||||
{
|
||||
QString whyNot;
|
||||
const bool enable = TestTreeModel::instance()->hasTests()
|
||||
TestTreeModel *model = TestTreeModel::instance();
|
||||
const bool enable = !model->parser()->isParsing() && model->hasTests()
|
||||
&& ProjectExplorer::ProjectExplorerPlugin::canRunStartupProject(
|
||||
ProjectExplorer::Constants::NORMAL_RUN_MODE, &whyNot);
|
||||
m_runAll->setEnabled(enable);
|
||||
|
||||
Reference in New Issue
Block a user