diff --git a/src/plugins/autotest/boost/boosttestframework.cpp b/src/plugins/autotest/boost/boosttestframework.cpp index 74a7880c988..2b9b4837b80 100644 --- a/src/plugins/autotest/boost/boosttestframework.cpp +++ b/src/plugins/autotest/boost/boosttestframework.cpp @@ -41,8 +41,7 @@ ITestTreeItem *BoostTestFramework::createRootNode() { return new BoostTestTreeItem( this, - QCoreApplication::translate("BoostTestFramework", - BoostTest::Constants::FRAMEWORK_SETTINGS_CATEGORY), + displayName(), Utils::FilePath(), ITestTreeItem::Root); } @@ -51,6 +50,12 @@ const char *BoostTestFramework::name() const return BoostTest::Constants::FRAMEWORK_NAME; } +QString BoostTestFramework::displayName() const +{ + return QCoreApplication::translate("BoostTestFramework", + BoostTest::Constants::FRAMEWORK_SETTINGS_CATEGORY); +} + unsigned BoostTestFramework::priority() const { return BoostTest::Constants::FRAMEWORK_PRIORITY; diff --git a/src/plugins/autotest/boost/boosttestframework.h b/src/plugins/autotest/boost/boosttestframework.h index 2ca7b608699..91f2bdac0f6 100644 --- a/src/plugins/autotest/boost/boosttestframework.h +++ b/src/plugins/autotest/boost/boosttestframework.h @@ -39,6 +39,7 @@ public: private: const char *name() const override; + QString displayName() const override; unsigned priority() const override; ITestSettings *testSettings() override { return &m_settings; } ITestParser *createTestParser() override; diff --git a/src/plugins/autotest/catch/catchframework.cpp b/src/plugins/autotest/catch/catchframework.cpp index 754703bf711..defa59b10d3 100644 --- a/src/plugins/autotest/catch/catchframework.cpp +++ b/src/plugins/autotest/catch/catchframework.cpp @@ -35,6 +35,11 @@ const char *CatchFramework::name() const return "Catch"; } +QString CatchFramework::displayName() const +{ + return QCoreApplication::translate("CatchFramework", "Catch Test"); +} + unsigned CatchFramework::priority() const { return 12; @@ -48,7 +53,7 @@ ITestParser *CatchFramework::createTestParser() ITestTreeItem *CatchFramework::createRootNode() { return new CatchTreeItem(this, - QCoreApplication::translate("CatchFramework", "Catch Test"), + displayName(), Utils::FilePath(), ITestTreeItem::Root); } diff --git a/src/plugins/autotest/catch/catchframework.h b/src/plugins/autotest/catch/catchframework.h index c49e79c9293..38de904f29a 100644 --- a/src/plugins/autotest/catch/catchframework.h +++ b/src/plugins/autotest/catch/catchframework.h @@ -37,6 +37,7 @@ public: CatchFramework() : ITestFramework(true) {} const char *name() const override; + QString displayName() const override; unsigned priority() const override; protected: diff --git a/src/plugins/autotest/ctest/ctesttool.cpp b/src/plugins/autotest/ctest/ctesttool.cpp index 4db818581eb..0f9bd8eecaf 100644 --- a/src/plugins/autotest/ctest/ctesttool.cpp +++ b/src/plugins/autotest/ctest/ctesttool.cpp @@ -50,10 +50,15 @@ const char *CTestTool::name() const return "CTest"; } +QString CTestTool::displayName() const +{ + return QCoreApplication::translate("CTestTool", "CTest"); +} + ITestTreeItem *CTestTool::createRootNode() { return new CTestTreeItem(this, - QCoreApplication::translate("CTestTool", "CTest"), + displayName(), Utils::FilePath(), ITestTreeItem::Root); } diff --git a/src/plugins/autotest/ctest/ctesttool.h b/src/plugins/autotest/ctest/ctesttool.h index ff0d3b75221..232a3a0f12d 100644 --- a/src/plugins/autotest/ctest/ctesttool.h +++ b/src/plugins/autotest/ctest/ctesttool.h @@ -42,6 +42,7 @@ public: protected: const char *name() const final; + QString displayName() const final; ITestTreeItem *createRootNode() final; private: diff --git a/src/plugins/autotest/gtest/gtestframework.cpp b/src/plugins/autotest/gtest/gtestframework.cpp index b093417324b..ec84108d68b 100644 --- a/src/plugins/autotest/gtest/gtestframework.cpp +++ b/src/plugins/autotest/gtest/gtestframework.cpp @@ -48,8 +48,7 @@ ITestTreeItem *GTestFramework::createRootNode() { return new GTestTreeItem( this, - QCoreApplication::translate("GTestFramework", - GTest::Constants::FRAMEWORK_SETTINGS_CATEGORY), + displayName(), Utils::FilePath(), ITestTreeItem::Root); } @@ -58,6 +57,12 @@ const char *GTestFramework::name() const return GTest::Constants::FRAMEWORK_NAME; } +QString GTestFramework:: displayName() const +{ + return QCoreApplication::translate("GTestFramework", + GTest::Constants::FRAMEWORK_SETTINGS_CATEGORY); +} + unsigned GTestFramework::priority() const { return GTest::Constants::FRAMEWORK_PRIORITY; diff --git a/src/plugins/autotest/gtest/gtestframework.h b/src/plugins/autotest/gtest/gtestframework.h index c7504d28e36..185b37ec98e 100644 --- a/src/plugins/autotest/gtest/gtestframework.h +++ b/src/plugins/autotest/gtest/gtestframework.h @@ -42,6 +42,7 @@ public: private: const char *name() const override; + QString displayName() const override; unsigned priority() const override; QString groupingToolTip() const override; ITestSettings *testSettings() override { return &m_settings; } diff --git a/src/plugins/autotest/itestframework.h b/src/plugins/autotest/itestframework.h index 6b30c70dd0e..acfd9592b9b 100644 --- a/src/plugins/autotest/itestframework.h +++ b/src/plugins/autotest/itestframework.h @@ -53,6 +53,7 @@ public: virtual ~ITestBase() = default; virtual const char *name() const = 0; + virtual QString displayName() const = 0; virtual unsigned priority() const = 0; // should this be modifyable? TestBaseType type() const { return m_type; } diff --git a/src/plugins/autotest/projectsettingswidget.cpp b/src/plugins/autotest/projectsettingswidget.cpp index 34152ff7be2..11841f56c27 100644 --- a/src/plugins/autotest/projectsettingswidget.cpp +++ b/src/plugins/autotest/projectsettingswidget.cpp @@ -127,7 +127,7 @@ void ProjectTestSettingsWidget::populateFrameworks(const QHashname())}); + auto item = new QTreeWidgetItem(m_activeFrameworks, {frameworkOrTestTool->displayName()}); item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable); item->setCheckState(0, checked ? Qt::Checked : Qt::Unchecked); item->setData(0, BaseIdRole, frameworkOrTestTool->id().toSetting()); diff --git a/src/plugins/autotest/qtest/qttestframework.cpp b/src/plugins/autotest/qtest/qttestframework.cpp index 23646e43d93..15686c57c96 100644 --- a/src/plugins/autotest/qtest/qttestframework.cpp +++ b/src/plugins/autotest/qtest/qttestframework.cpp @@ -40,8 +40,7 @@ ITestTreeItem *QtTestFramework::createRootNode() { return new QtTestTreeItem( this, - QCoreApplication::translate("QtTestFramework", - QtTest::Constants::FRAMEWORK_SETTINGS_CATEGORY), + displayName(), Utils::FilePath(), ITestTreeItem::Root); } @@ -50,6 +49,12 @@ const char *QtTestFramework::name() const return QtTest::Constants::FRAMEWORK_NAME; } +QString QtTestFramework::displayName() const +{ + return QCoreApplication::translate("QtTestFramework", + QtTest::Constants::FRAMEWORK_SETTINGS_CATEGORY); +} + unsigned QtTestFramework::priority() const { return QtTest::Constants::FRAMEWORK_PRIORITY; diff --git a/src/plugins/autotest/qtest/qttestframework.h b/src/plugins/autotest/qtest/qttestframework.h index d75e07044be..e02f3c16dd6 100644 --- a/src/plugins/autotest/qtest/qttestframework.h +++ b/src/plugins/autotest/qtest/qttestframework.h @@ -39,6 +39,7 @@ public: private: const char *name() const override; + QString displayName() const override; unsigned priority() const override; ITestParser *createTestParser() override; ITestTreeItem *createRootNode() override; diff --git a/src/plugins/autotest/quick/quicktestframework.cpp b/src/plugins/autotest/quick/quicktestframework.cpp index e4fecb1daf0..1a72669ae88 100644 --- a/src/plugins/autotest/quick/quicktestframework.cpp +++ b/src/plugins/autotest/quick/quicktestframework.cpp @@ -41,7 +41,7 @@ ITestParser *QuickTestFramework::createTestParser() ITestTreeItem *QuickTestFramework::createRootNode() { - return new QuickTestTreeItem(this, QCoreApplication::translate("QuickTestFramework", "Quick Test"), + return new QuickTestTreeItem(this, displayName(), Utils::FilePath(), ITestTreeItem::Root); } @@ -50,6 +50,11 @@ const char *QuickTestFramework::name() const return QuickTest::Constants::FRAMEWORK_NAME; } +QString QuickTestFramework::displayName() const +{ + return QCoreApplication::translate("QuickTestFramework", "Quick Test"); +} + unsigned QuickTestFramework::priority() const { return 5; diff --git a/src/plugins/autotest/quick/quicktestframework.h b/src/plugins/autotest/quick/quicktestframework.h index 316a5a9f380..1600e03f34d 100644 --- a/src/plugins/autotest/quick/quicktestframework.h +++ b/src/plugins/autotest/quick/quicktestframework.h @@ -43,6 +43,7 @@ class QuickTestFramework : public ITestFramework public: QuickTestFramework() : ITestFramework(true) {} const char *name() const override; + QString displayName() const override; unsigned priority() const override; ITestSettings *testSettings() override; diff --git a/src/plugins/autotest/testsettingspage.cpp b/src/plugins/autotest/testsettingspage.cpp index f03cdd1cf5f..437355a40fa 100644 --- a/src/plugins/autotest/testsettingspage.cpp +++ b/src/plugins/autotest/testsettingspage.cpp @@ -115,7 +115,7 @@ void TestSettingsWidget::populateFrameworksListWidget(const QHashclear(); for (const ITestFramework *framework : registered) { const Utils::Id id = framework->id(); - auto item = new QTreeWidgetItem(m_ui.frameworkTreeWidget, QStringList(QLatin1String(framework->name()))); + auto item = new QTreeWidgetItem(m_ui.frameworkTreeWidget, {framework->displayName()}); item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable); item->setCheckState(0, frameworks.value(id) ? Qt::Checked : Qt::Unchecked); item->setData(0, BaseId, id.toSetting()); @@ -132,7 +132,7 @@ void TestSettingsWidget::populateFrameworksListWidget(const QHashid(); - auto item = new QTreeWidgetItem(m_ui.frameworkTreeWidget, {QLatin1String(testTool->name())}); + auto item = new QTreeWidgetItem(m_ui.frameworkTreeWidget, {testTool->displayName()}); item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable); item->setCheckState(0, testTools.value(id) ? Qt::Checked : Qt::Unchecked); item->setData(0, BaseId, id.toSetting());