AutoTest: Avoid building tree of global items

Global items normally have no test name set. This patch avoids
adding global items below other global items.

Change-Id: Iabada78144ec48fc6687b360f79f1ef017c772a1
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2016-12-19 13:54:53 +01:00
parent a8854b680e
commit 41ceac474b

View File

@@ -292,7 +292,7 @@ TestResultItem *TestResultModel::findParentItemFor(const TestResultItem *item,
const TestResult *result = item->testResult();
const QString &name = result->name();
if (root == nullptr) {
if (root == nullptr && !name.isEmpty()) {
for (int row = rootItem()->childCount() - 1; row >= 0; --row) {
TestResultItem *tmp = static_cast<TestResultItem *>(rootItem()->childAt(row));
if (tmp->testResult()->name() == name) {