Commit 60de0b74 authored by Christian Stenger's avatar Christian Stenger

AutoTest: Do not blindly mark tree items for removal

If we want to mark test tree items because of their file name
explicitly for removal we must not mark its children
recursively without looking at their content. (Grand-)Children
might have a different file and won't get updated ('unmarked')
when just parsing single files which in turn would lead to
sweeping them after parsing.

Task-number: QTCREATORBUG-18689
Change-Id: Ic28dda5652899308a71d2bd3c28a7fde89a08a0e
Reviewed-by: Oliver Wolff's avatarOliver Wolff <oliver.wolff@qt.io>
parent f974fb49
......@@ -207,13 +207,11 @@ void TestTreeItem::markForRemovalRecursively(bool mark)
void TestTreeItem::markForRemovalRecursively(const QString &filePath)
{
if (m_filePath == filePath) {
markForRemovalRecursively(true);
} else {
for (int row = 0, count = childCount(); row < count; ++row) {
TestTreeItem *child = childItem(row);
child->markForRemovalRecursively(filePath);
}
if (m_filePath == filePath)
markForRemoval(true);
for (int row = 0, count = childCount(); row < count; ++row) {
TestTreeItem *child = childItem(row);
child->markForRemovalRecursively(filePath);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment