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 <oliver.wolff@qt.io>
This commit is contained in:
Christian Stenger
2017-08-08 13:46:33 +02:00
parent f974fb4964
commit 60de0b7405

View File

@@ -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);
}
}