From 90fd6870c5a15ecc128116766bec30f673746750 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 17 Apr 2020 16:40:47 +0200 Subject: [PATCH] AutoTest: Simplify QuickTestTreeItem::markForRemovalRecursively() Change-Id: I3ab1876aa2d4dc04b9b5d53f373751e0f5241e75 Reviewed-by: Christian Stenger --- src/plugins/autotest/quick/quicktesttreeitem.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/plugins/autotest/quick/quicktesttreeitem.cpp b/src/plugins/autotest/quick/quicktesttreeitem.cpp index 66a95c106e9..5274a270993 100644 --- a/src/plugins/autotest/quick/quicktesttreeitem.cpp +++ b/src/plugins/autotest/quick/quicktesttreeitem.cpp @@ -430,15 +430,10 @@ QSet QuickTestTreeItem::internalTargets() const void QuickTestTreeItem::markForRemovalRecursively(const QString &filePath) { - static const Core::Id id = Core::Id(Constants::FRAMEWORK_PREFIX).withSuffix( - QuickTest::Constants::FRAMEWORK_NAME); - TestTreeItem::markForRemovalRecursively(filePath); - ITestFramework *framework = TestFrameworkManager::frameworkForId(id); - QTC_ASSERT(framework, return); - auto parser = dynamic_cast(framework->testParser()); + auto parser = dynamic_cast(framework()->testParser()); const QString proFile = parser->projectFileForMainCppFile(filePath); if (!proFile.isEmpty()) { - TestTreeItem *root = framework->rootNode(); + TestTreeItem *root = framework()->rootNode(); root->forAllChildren([proFile](TestTreeItem *it) { if (it->proFile() == proFile) it->markForRemoval(true);