From 481070d8080fd51f79867860a27bb0cae6600c3f Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 3 Sep 2021 15:27:03 +0200 Subject: [PATCH] AutoTest: Fix test tools handling for project settings Fixes restoring project settings with enabled test tools but having globally disabled these. We need to take the real active state for test tools into account not only the global one. Kind of enhances b99d7623f30208. Change-Id: I29c8cc4fff7c82140da41d3c85823d5980c96d9f Reviewed-by: David Schulz --- src/plugins/autotest/testtreemodel.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/plugins/autotest/testtreemodel.cpp b/src/plugins/autotest/testtreemodel.cpp index 8992fdeabeb..696db9fd907 100644 --- a/src/plugins/autotest/testtreemodel.cpp +++ b/src/plugins/autotest/testtreemodel.cpp @@ -96,6 +96,7 @@ void TestTreeModel::setupParsingConnections() synchronizeTestFrameworks(); // we might have project settings m_parser->onStartupProjectChanged(project); removeAllTestToolItems(); + synchronizeTestTools(); m_checkStateCache = project ? AutotestPlugin::projectSettings(project)->checkStateCache() : nullptr; onBuildSystemTestsUpdated(); // we may have old results if project was open before switching @@ -266,8 +267,14 @@ void TestTreeModel::onBuildSystemTestsUpdated() m_checkStateCache->evolve(ITestBase::Tool); ITestTool *testTool = TestFrameworkManager::testToolForBuildSystemId(bs->project()->id()); - if (!testTool || !testTool->active()) + if (!testTool) return; + // FIXME + const TestProjectSettings *projectSettings = AutotestPlugin::projectSettings(bs->project()); + if ((projectSettings->useGlobalSettings() && !testTool->active()) + || !projectSettings->activeTestTools().contains(testTool)) { + return; + } ITestTreeItem *rootNode = testTool->rootNode(); QTC_ASSERT(rootNode, return); @@ -281,6 +288,7 @@ void TestTreeModel::onBuildSystemTestsUpdated() rootNode->appendChild(item); } revalidateCheckState(rootNode); + emit testTreeModelChanged(); } const QList TestTreeModel::frameworkRootNodes() const