TestResult: Devirtualize the class - part 3 of 5

Step 3 - implement directParentHook.

Change-Id: I87518e700e9019ccd5b8a095b23971ae26eb776e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Jarek Kobus
2023-01-14 11:31:15 +01:00
parent a7f0c8e81b
commit b1ef25b208
11 changed files with 169 additions and 131 deletions

View File

@@ -156,10 +156,15 @@ QColor TestResult::colorForType(const ResultType type)
}
}
bool TestResult::isDirectParentOf(const TestResult *other, bool * /*needsIntermediate*/) const
bool TestResult::isDirectParentOf(const TestResult *other, bool *needsIntermediate) const
{
QTC_ASSERT(other, return false);
return !m_id.isEmpty() && m_id == other->m_id && m_name == other->m_name;
const bool ret = !m_id.isEmpty() && m_id == other->m_id && m_name == other->m_name;
if (!ret)
return false;
if (m_hooks.directParent)
return m_hooks.directParent(*this, *other, needsIntermediate);
return true;
}
bool TestResult::isIntermediateFor(const TestResult *other) const