forked from qt-creator/qt-creator
AutoTest: Postpone removal of root node
If a root node should get removed while scanning we may end up crashing when still getting results. As there is currently no mechanism to stop a certain parser postpone the removal of the root node until the parsing is done. Change-Id: I3766f9e67780e241801166339fa67f39536314b4 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -214,12 +214,16 @@ bool TestTreeItem::modifyLineAndColumn(const TestParseResult *result)
|
||||
|
||||
void TestTreeItem::markForRemoval(bool mark)
|
||||
{
|
||||
m_status = mark ? MarkedForRemoval : Cleared;
|
||||
if (type() == Root)
|
||||
m_status = mark ? ForcedRootRemoval : NewlyAdded;
|
||||
else
|
||||
m_status = mark ? MarkedForRemoval : Cleared;
|
||||
}
|
||||
|
||||
void TestTreeItem::markForRemovalRecursively(bool mark)
|
||||
{
|
||||
markForRemoval(mark);
|
||||
if (type() != Root)
|
||||
markForRemoval(mark);
|
||||
for (int row = 0, count = childCount(); row < count; ++row)
|
||||
childItem(row)->markForRemovalRecursively(mark);
|
||||
}
|
||||
@@ -231,7 +235,8 @@ void TestTreeItem::markForRemovalRecursively(const QSet<FilePath> &filePaths)
|
||||
child->markForRemovalRecursively(filePaths);
|
||||
mark &= child->markedForRemoval();
|
||||
});
|
||||
markForRemoval(mark);
|
||||
if (type() != Root)
|
||||
markForRemoval(mark);
|
||||
}
|
||||
|
||||
TestTreeItem *TestTreeItem::childItem(int at) const
|
||||
|
||||
Reference in New Issue
Block a user