forked from qt-creator/qt-creator
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: Niels Weber <niels.weber@theqtcompany.com> Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user