diff options
author | Eike Ziller <eike.ziller@qt.io> | 2018-03-01 15:46:37 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2018-03-01 15:46:37 +0100 |
commit | 205c930592ce32d5fe98eb68f1100052dbe96b92 (patch) | |
tree | 1afc5ace06abde75ce63e138baa9524743542a48 /src/plugins/autotest/autotestplugin.cpp | |
parent | 5e2ad9457f8681aa14b8a2f4029a88c89bbcdbbd (diff) | |
parent | ec571d86fde5d0ee3ea42613ccd8ebfd843c03a0 (diff) |
Merge remote-tracking branch 'origin/4.6'
Change-Id: I63f8aebb201936f671b1486ff9420f67e5e3fafc
Diffstat (limited to 'src/plugins/autotest/autotestplugin.cpp')
-rw-r--r-- | src/plugins/autotest/autotestplugin.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/plugins/autotest/autotestplugin.cpp b/src/plugins/autotest/autotestplugin.cpp index 46defa4a57..1d850f1240 100644 --- a/src/plugins/autotest/autotestplugin.cpp +++ b/src/plugins/autotest/autotestplugin.cpp @@ -190,16 +190,16 @@ void AutotestPlugin::onRunSelectedTriggered() void AutotestPlugin::updateMenuItemsEnabledState() { - const bool enabled = !ProjectExplorer::BuildManager::isBuilding() - && !TestRunner::instance()->isTestRunning() - && TestTreeModel::instance()->parser()->state() == TestCodeParser::Idle + const bool canScan = !TestRunner::instance()->isTestRunning() + && TestTreeModel::instance()->parser()->state() == TestCodeParser::Idle; + const bool hasTests = TestTreeModel::instance()->hasTests(); + const bool canRun = hasTests && canScan && ProjectExplorer::ProjectExplorerPlugin::canRunStartupProject( ProjectExplorer::Constants::NORMAL_RUN_MODE); - const bool hasTests = TestTreeModel::instance()->hasTests(); - ActionManager::command(Constants::ACTION_RUN_ALL_ID)->action()->setEnabled(enabled && hasTests); - ActionManager::command(Constants::ACTION_RUN_SELECTED_ID)->action()->setEnabled(enabled && hasTests); - ActionManager::command(Constants::ACTION_SCAN_ID)->action()->setEnabled(enabled); + ActionManager::command(Constants::ACTION_RUN_ALL_ID)->action()->setEnabled(canRun); + ActionManager::command(Constants::ACTION_RUN_SELECTED_ID)->action()->setEnabled(canRun); + ActionManager::command(Constants::ACTION_SCAN_ID)->action()->setEnabled(canScan); } QList<QObject *> AutotestPlugin::createTestObjects() const |