diff options
author | hjk <hjk@qt.io> | 2020-04-17 17:04:35 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2020-04-22 05:46:44 +0000 |
commit | 628569609149ab90628d145bba879ff91ea75c6a (patch) | |
tree | 126644acca5ba6196470a744218ef2685fd89bde /src/plugins/autotest/itestframework.h | |
parent | 90fd6870c5a15ecc128116766bec30f673746750 (diff) |
AutoTest: Add a itestframework.cpp
To get a few things out-of-line in itestframework.h.
Change-Id: Iae6f702b789c98b17a4d255008736377030e3b6c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/autotest/itestframework.h')
-rw-r--r-- | src/plugins/autotest/itestframework.h | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/src/plugins/autotest/itestframework.h b/src/plugins/autotest/itestframework.h index 27efbaaa60..960b9d8ad5 100644 --- a/src/plugins/autotest/itestframework.h +++ b/src/plugins/autotest/itestframework.h @@ -35,34 +35,19 @@ class IFrameworkSettings; class ITestFramework { public: - explicit ITestFramework(bool activeByDefault) : m_active(activeByDefault) {} - virtual ~ITestFramework() - { - delete m_testParser; - } + explicit ITestFramework(bool activeByDefault); + virtual ~ITestFramework(); virtual const char *name() const = 0; virtual unsigned priority() const = 0; // should this be modifyable? virtual IFrameworkSettings *frameworkSettings() { return nullptr; } - TestTreeItem *rootNode() - { if (!m_rootNode) - m_rootNode = createRootNode(); - // These are stored in the TestTreeModel and destroyed on shutdown there. - return m_rootNode; - } - - ITestParser *testParser() - { - if (!m_testParser) - m_testParser = createTestParser(); - return m_testParser; - } + TestTreeItem *rootNode(); + ITestParser *testParser(); Core::Id settingsId() const; - - Core::Id id() const { return Core::Id(Constants::FRAMEWORK_PREFIX).withSuffix(name()); } + Core::Id id() const; bool active() const { return m_active; } void setActive(bool active) { m_active = active; } @@ -71,15 +56,7 @@ public: // framework specific tool tip to be displayed on the general settings page virtual QString groupingToolTip() const { return QString(); } - void resetRootNode() - { - if (!m_rootNode) - return; - if (m_rootNode->model()) - static_cast<TestTreeModel *>(m_rootNode->model())->takeItem(m_rootNode); - delete m_rootNode; - m_rootNode = nullptr; - } + void resetRootNode(); protected: virtual ITestParser *createTestParser() = 0; |