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:
Christian Stenger
2017-01-09 07:53:55 +01:00
parent 1770438732
commit 0161b3238e

View File

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