Commit 0d01a0c7 authored by Christian Stenger's avatar Christian Stenger
Browse files

Simplify check state handling



Data functions and special functions cannot be checked at all, so
there is no need to inherit the state by its parent.

Change-Id: If72f79ef6bcd77628916bd7fbe137faa5555db41
Reviewed-by: default avatarNiels Weber <niels.weber@theqtcompany.com>
Reviewed-by: default avatarDavid Schulz <david.schulz@theqtcompany.com>
parent 274d095f
......@@ -30,21 +30,10 @@ TestTreeItem::TestTreeItem(const QString &name, const QString &filePath, Type ty
m_parent(parent)
{
switch (m_type) {
case ROOT:
m_checked = Qt::Unchecked;
break;
case TEST_CLASS:
case TEST_FUNCTION:
m_checked = Qt::Checked;
break;
case TEST_DATAFUNCTION:
case TEST_SPECIALFUNCTION:
if (m_parent)
m_checked = m_parent->checked() == Qt::PartiallyChecked ? Qt::Unchecked
: m_parent->checked();
else
m_checked = Qt::Unchecked;
break;
default:
m_checked = Qt::Unchecked;
}
......@@ -169,7 +158,7 @@ Qt::CheckState TestTreeItem::checked() const
return m_checked;
case TEST_DATAFUNCTION:
case TEST_SPECIALFUNCTION:
return m_parent->m_checked == Qt::PartiallyChecked ? Qt::Unchecked : m_parent->m_checked;
return Qt::Unchecked;
default:
if (m_parent)
return m_parent->m_checked;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment