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>
This commit is contained in:
hjk
2020-01-09 17:32:51 +01:00
parent 675c414b07
commit 1eaf44a270
20 changed files with 45 additions and 65 deletions

View File

@@ -132,13 +132,14 @@ private:
Internal::BuildConfigurationPrivate *d = nullptr;
};
class PROJECTEXPLORER_EXPORT BuildConfigurationFactory : public QObject
class PROJECTEXPLORER_EXPORT BuildConfigurationFactory
{
Q_OBJECT
protected:
BuildConfigurationFactory();
~BuildConfigurationFactory() override;
BuildConfigurationFactory(const BuildConfigurationFactory &) = delete;
BuildConfigurationFactory &operator=(const BuildConfigurationFactory &) = delete;
virtual ~BuildConfigurationFactory(); // Needed for dynamic_casts in importers.
public:
// List of build information that can be used to create a new build configuration via
@@ -178,7 +179,6 @@ protected:
template <class BuildConfig>
void registerBuildConfiguration(Core::Id buildConfigId)
{
setObjectName(buildConfigId.toString() + "BuildConfigurationFactory");
m_creator = [buildConfigId](Target *t) { return new BuildConfig(t, buildConfigId); };
m_buildConfigId = buildConfigId;
}