summaryrefslogtreecommitdiff
path: root/plugins/autotest/testtreemodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/autotest/testtreemodel.cpp')
-rw-r--r--plugins/autotest/testtreemodel.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/plugins/autotest/testtreemodel.cpp b/plugins/autotest/testtreemodel.cpp
index f2ea94d626..bccabf898a 100644
--- a/plugins/autotest/testtreemodel.cpp
+++ b/plugins/autotest/testtreemodel.cpp
@@ -61,8 +61,6 @@ TestTreeModel::TestTreeModel(QObject *parent) :
connect(m_parser, &TestCodeParser::unnamedQuickTestsRemoved,
this, &TestTreeModel::removeUnnamedQuickTests);
- m_parser->updateTestTree();
-
// CppTools::CppModelManagerInterface *cppMM = CppTools::CppModelManagerInterface::instance();
// if (cppMM) {
// // replace later on by
@@ -808,6 +806,27 @@ void TestTreeModel::processChildren(QModelIndex &parentIndex, const TestTreeItem
}
}
+#ifdef WITH_TESTS
+int TestTreeModel::autoTestsCount() const
+{
+ return m_autoTestRootItem ? m_autoTestRootItem->childCount() : 0;
+}
+
+int TestTreeModel::namedQuickTestsCount() const
+{
+ return m_quickTestRootItem
+ ? m_quickTestRootItem->childCount() - (hasUnnamedQuickTests() ? 1 : 0)
+ : 0;
+}
+
+int TestTreeModel::unnamedQuickTestsCount() const
+{
+ if (TestTreeItem *unnamed = unnamedQuickTests())
+ return unnamed->childCount();
+ return 0;
+}
+#endif
+
/***************************** Sort/Filter Model **********************************/
TestTreeSortFilterModel::TestTreeSortFilterModel(TestTreeModel *sourceModel, QObject *parent)