forked from qt-creator/qt-creator
AutoTest: Avoid unneeded duplication on rebuild
When the rebuild of the tree model has been triggered due to switching between grouping by filter or directory it could happen that some children did not get merged into others due to (insignificant) differences. Avoid this visual duplication by finding items similar to the one to be added and if there is one re-use this instead. Change-Id: Ife49593638e0af23ffc7353e305be4ea25eb2180 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -229,6 +229,13 @@ TestTreeItem *TestTreeItem::findChildByFile(const QString &filePath)
|
||||
});
|
||||
}
|
||||
|
||||
TestTreeItem *TestTreeItem::findChildByFileAndType(const QString &filePath, Type tType)
|
||||
{
|
||||
return findChildBy([filePath, tType](const TestTreeItem *other) {
|
||||
return other->type() == tType && other->filePath() == filePath;
|
||||
});
|
||||
}
|
||||
|
||||
TestTreeItem *TestTreeItem::findChildByNameAndFile(const QString &name, const QString &filePath)
|
||||
{
|
||||
return findChildBy([name, filePath](const TestTreeItem *other) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user