diff options
author | Christian Stenger <christian.stenger@theqtcompany.com> | 2015-03-03 13:14:31 +0100 |
---|---|---|
committer | Christian Stenger <christian.stenger@theqtcompany.com> | 2015-03-03 15:36:43 +0200 |
commit | 535f1eec182b54011e2b32a625ba048e8e99ec98 (patch) | |
tree | c1ff1551caca476eb294a9d46a7469fa5363372a /plugins/autotest/testcodeparser.cpp | |
parent | aba2844a5aecb506d97d869ccd74e8bf76393883 (diff) |
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>
Diffstat (limited to 'plugins/autotest/testcodeparser.cpp')
-rw-r--r-- | plugins/autotest/testcodeparser.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/plugins/autotest/testcodeparser.cpp b/plugins/autotest/testcodeparser.cpp index 3cd3ea518a..6b2ff8d4a8 100644 --- a/plugins/autotest/testcodeparser.cpp +++ b/plugins/autotest/testcodeparser.cpp @@ -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); + } } } } |