forked from qt-creator/qt-creator
Fix removing unnamed quick tests...
...this was wrong especially when closing (the last) open project that contained unnamed quick tests. Change-Id: I6d030b6219d9f397a6ffb51a985ef4147eebec8a Reviewed-by: David Schulz <david.schulz@theqtcompany.com> Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -672,14 +672,16 @@ void TestCodeParser::removeTestsIfNecessary(const QString &fileName)
|
||||
emit testItemsRemoved(file, TestTreeModel::QuickTest);
|
||||
}
|
||||
// unnamed Quick Tests must be handled separately
|
||||
removeUnnamedQuickTestsByName(fileName);
|
||||
|
||||
QSet<QString> filePaths;
|
||||
QList<QString> functionNames;
|
||||
if (m_model->hasUnnamedQuickTests()) {
|
||||
m_model->qmlFilesAndFunctionNamesForMainFile(fileName, &filePaths, &functionNames);
|
||||
foreach (const QString &file, filePaths)
|
||||
emit testItemsRemoved(file, TestTreeModel::QuickTest);
|
||||
if (fileName.endsWith(QLatin1String(".qml"))) {
|
||||
removeUnnamedQuickTestsByName(fileName);
|
||||
emit unnamedQuickTestsRemoved(fileName);
|
||||
} else {
|
||||
m_model->qmlFilesForMainFile(fileName, &filePaths);
|
||||
foreach (const QString &file, filePaths) {
|
||||
removeUnnamedQuickTestsByName(file);
|
||||
emit unnamedQuickTestsRemoved(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user