forked from qt-creator/qt-creator
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user