From 0161b3238e4fb7703c1e37709cf85b57e8894802 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 9 Jan 2017 07:53:55 +0100 Subject: [PATCH] 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 --- src/plugins/autotest/testtreemodel.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/plugins/autotest/testtreemodel.cpp b/src/plugins/autotest/testtreemodel.cpp index 6d53f31baaa..429e392e7e1 100644 --- a/src/plugins/autotest/testtreemodel.cpp +++ b/src/plugins/autotest/testtreemodel.cpp @@ -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(); } - hasChanged |= child->newlyAdded(); - child->markForRemoval(false); } return hasChanged; }