From 1fa26bd9b3dd5269dc44a000cd525e26e6904328 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 29 Sep 2017 12:36:26 +0200 Subject: [PATCH] AutoTest: Restrict Run and Debug from results pane Ensure to enable Run and Debug from results pane only for items that are in fact capable to get re-run and debugged. Preparation for enabling the functionality for QTest and Quick Tests. Change-Id: I7ec28e51ae7c9caa462023d55443bd3194ae81dd Reviewed-by: Claus Steuer Reviewed-by: Oliver Wolff --- src/plugins/autotest/testresultspane.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/autotest/testresultspane.cpp b/src/plugins/autotest/testresultspane.cpp index c3317fdfe96..9f2f8431ea1 100644 --- a/src/plugins/autotest/testresultspane.cpp +++ b/src/plugins/autotest/testresultspane.cpp @@ -583,15 +583,16 @@ void TestResultsPane::onCustomContextMenuRequested(const QPoint &pos) connect(action, &QAction::triggered, this, &TestResultsPane::onSaveWholeTriggered); menu.addAction(action); + const auto correlatingItem = clicked ? clicked->findTestTreeItem() : nullptr; action = new QAction(tr("Run This Test"), &menu); - action->setEnabled(clicked && clicked->findTestTreeItem()); + action->setEnabled(correlatingItem && correlatingItem->canProvideTestConfiguration()); connect(action, &QAction::triggered, this, [this, clicked] { onRunThisTestTriggered(TestRunMode::Run, clicked); }); menu.addAction(action); action = new QAction(tr("Debug This Test"), &menu); - action->setEnabled(clicked && clicked->findTestTreeItem()); + action->setEnabled(correlatingItem && correlatingItem->canProvideDebugConfiguration()); connect(action, &QAction::triggered, this, [this, clicked] { onRunThisTestTriggered(TestRunMode::Debug, clicked); });