diff --git a/src/plugins/autotest/testtreeitem.cpp b/src/plugins/autotest/testtreeitem.cpp index a597a2de7ad..362465e923b 100644 --- a/src/plugins/autotest/testtreeitem.cpp +++ b/src/plugins/autotest/testtreeitem.cpp @@ -196,12 +196,13 @@ void TestTreeItem::markForRemovalRecursively(bool mark) void TestTreeItem::markForRemovalRecursively(const QString &filePath) { - if (m_filePath == filePath) - markForRemoval(true); + bool mark = m_filePath == filePath; for (int row = 0, count = childCount(); row < count; ++row) { TestTreeItem *child = childItem(row); child->markForRemovalRecursively(filePath); + mark &= child->markedForRemoval(); } + markForRemoval(mark); } TestTreeItem *TestTreeItem::parentItem() const