forked from qt-creator/qt-creator
AutoTest: Fix sweepChildren()
Introducing support for inheritance broke some old functionality which in fact was just over engineered. Remove additional code which will be automatically handled and does not need to get handled by special logic which could be now wrong. Change-Id: I05a063c41dc0f8f644d0807fc5497de9c4461246 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -236,18 +236,11 @@ bool TestTreeModel::sweepChildren(TestTreeItem *item)
|
||||
if (child->parentItem()->type() != TestTreeItem::Root && child->markedForRemoval()) {
|
||||
destroyItem(child);
|
||||
hasChanged = true;
|
||||
continue;
|
||||
}
|
||||
if (bool noEndNode = child->hasChildren()) {
|
||||
} else if (child->hasChildren()) {
|
||||
hasChanged |= sweepChildren(child);
|
||||
if (noEndNode && child->childCount() == 0) {
|
||||
destroyItem(child);
|
||||
hasChanged = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
hasChanged |= child->newlyAdded();
|
||||
child->markForRemoval(false);
|
||||
}
|
||||
}
|
||||
return hasChanged;
|
||||
}
|
||||
|
Reference in New Issue
Block a user