aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/autotest/autotestplugin.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2018-03-01 15:46:37 +0100
committerEike Ziller <eike.ziller@qt.io>2018-03-01 15:46:37 +0100
commit205c930592ce32d5fe98eb68f1100052dbe96b92 (patch)
tree1afc5ace06abde75ce63e138baa9524743542a48 /src/plugins/autotest/autotestplugin.cpp
parent5e2ad9457f8681aa14b8a2f4029a88c89bbcdbbd (diff)
parentec571d86fde5d0ee3ea42613ccd8ebfd843c03a0 (diff)
Merge remote-tracking branch 'origin/4.6'
Diffstat (limited to 'src/plugins/autotest/autotestplugin.cpp')
-rw-r--r--src/plugins/autotest/autotestplugin.cpp14
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