diff options
author | hjk <hjk@qt.io> | 2020-01-09 17:32:51 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2020-01-10 12:46:38 +0000 |
commit | 1eaf44a270dbc8ed3fb6aab24c7d267510acfd84 (patch) | |
tree | 60136b971fe2705d7008007965a0e0ed086e4468 /src/plugins/qmakeprojectmanager | |
parent | 675c414b0799f6bed356d77f9f114578b19bfea7 (diff) | |
download | qt-creator-1eaf44a270dbc8ed3fb6aab24c7d267510acfd84.tar.gz |
ProjectExplorer: De-QObject-ify BuildConfigurationFactories
The QObject was not heavily used. Object name was for debugging only,
translation context can be taken from the corresponding BuildConfiguration
objects, the qobject_casts in the three big importers are replaced by
dynamic_cast, which is good enough in that context.
Take the opportunity to re-use translations from base BuildConfiguration
for the common cases and sprinkle in some 'final'.
Change-Id: I8e9727c98c6e943cb333556861c24e701c2bdf45
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/qmakeprojectmanager')
3 files changed, 7 insertions, 9 deletions
diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp index fdf0baf2aa..ca2680deec 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp @@ -750,9 +750,9 @@ BuildInfo QmakeBuildConfigurationFactory::createBuildInfo(const Kit *k, if (type == BuildConfiguration::Release) { //: The name of the release build configuration created by default for a qmake project. - info.displayName = tr("Release"); + info.displayName = BuildConfiguration::tr("Release"); //: Non-ASCII characters in directory suffix may cause build issues. - suffix = tr("Release", "Shadow build directory suffix"); + suffix = QmakeBuildConfiguration::tr("Release", "Shadow build directory suffix"); if (settings.qtQuickCompiler == TriState::Default) { if (version && version->isQtQuickCompilerSupported()) extraInfo.config.useQtQuickCompiler = TriState::Enabled; @@ -760,14 +760,14 @@ BuildInfo QmakeBuildConfigurationFactory::createBuildInfo(const Kit *k, } else { if (type == BuildConfiguration::Debug) { //: The name of the debug build configuration created by default for a qmake project. - info.displayName = tr("Debug"); + info.displayName = BuildConfiguration::tr("Debug"); //: Non-ASCII characters in directory suffix may cause build issues. - suffix = tr("Debug", "Shadow build directory suffix"); + suffix = QmakeBuildConfiguration::tr("Debug", "Shadow build directory suffix"); } else if (type == BuildConfiguration::Profile) { //: The name of the profile build configuration created by default for a qmake project. - info.displayName = tr("Profile"); + info.displayName = BuildConfiguration::tr("Profile"); //: Non-ASCII characters in directory suffix may cause build issues. - suffix = tr("Profile", "Shadow build directory suffix"); + suffix = QmakeBuildConfiguration::tr("Profile", "Shadow build directory suffix"); if (settings.separateDebugInfo == TriState::Default) extraInfo.config.separateDebugInfo = TriState::Enabled; diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h index 28cabf1693..c2e947127f 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h @@ -153,8 +153,6 @@ private: class QMAKEPROJECTMANAGER_EXPORT QmakeBuildConfigurationFactory : public ProjectExplorer::BuildConfigurationFactory { - Q_OBJECT - public: QmakeBuildConfigurationFactory(); diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp index 2af28afa03..2a16f1e7fd 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp @@ -235,7 +235,7 @@ Kit *QmakeProjectImporter::createKit(void *directoryData) const const QList<BuildInfo> QmakeProjectImporter::buildInfoListForKit(const Kit *k, void *directoryData) const { auto *data = static_cast<DirectoryData *>(directoryData); - auto factory = qobject_cast<QmakeBuildConfigurationFactory *>( + auto factory = dynamic_cast<QmakeBuildConfigurationFactory *>( BuildConfigurationFactory::find(k, projectFilePath())); if (!factory) return {}; |