Autotests: emit testTreeModelChanged when new tests are added.

The signal used to be emitted only on reset or when tests are actually removed during sweep phase:
thus the 'run tests' button in test panel stayed disabled if the panel was opened while tests were
scanned.

Change-Id: I274c9d03f1e1140c8aa375f92465c5a0c866cd62
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
Francois Ferrand
2016-03-04 11:56:56 +01:00
parent 04a68518c9
commit 3d82a67484
3 changed files with 14 additions and 5 deletions

View File

@@ -42,7 +42,7 @@ TestTreeItem::TestTreeItem(const QString &name, const QString &filePath, Type ty
m_filePath(filePath),
m_type(type),
m_line(0),
m_markedForRemoval(false)
m_status(NewlyAdded)
{
m_checked = (m_type == TestCase || m_type == TestFunctionOrSet) ? Qt::Checked : Qt::Unchecked;
}
@@ -207,12 +207,12 @@ Qt::CheckState TestTreeItem::checked() const
void TestTreeItem::markForRemoval(bool mark)
{
m_markedForRemoval = mark;
m_status = mark ? MarkedForRemoval : Cleared;
}
void TestTreeItem::markForRemovalRecursively(bool mark)
{
m_markedForRemoval = mark;
markForRemoval(mark);
for (int row = 0, count = childCount(); row < count; ++row)
childItem(row)->markForRemovalRecursively(mark);
}