ProjectExplorer: Streamline RunConfigurationFactory interface

canHandle() is only used locally in the implementation, so
make it private and de-virtualize.

canCreateHelper() did nothing except returning true anymore,
so remove it.

Change-Id: Ifac39e077e3c296b2b2dfc9fbb29c20884e056a3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2018-03-19 13:18:27 +01:00
parent 98e26dc6fb
commit 232e8712a5
2 changed files with 7 additions and 20 deletions

View File

@@ -499,15 +499,12 @@ RunConfigurationFactory::availableCreators(Target *parent) const
}
/*!
Specifies a list of device types for which this RunConfigurationFactory
can create RunConfiguration.
Adds a list of device types for which this RunConfigurationFactory
can create RunConfigurations.
Not calling this function or using an empty list means no restriction.
If this function is never called for a RunConfiguarionFactory,
the factory will create RunConfigurations for all device types.
*/
void RunConfigurationFactory::setSupportedTargetDeviceTypes(const QList<Core::Id> &ids)
{
m_supportedTargetDeviceTypes = ids;
}
void RunConfigurationFactory::addSupportedTargetDeviceType(Core::Id id)
{
@@ -544,20 +541,12 @@ bool RunConfigurationFactory::canHandle(Target *target) const
return true;
}
bool RunConfigurationFactory::canCreateHelper(Target *, const QString &) const
{
return true;
}
RunConfiguration *RunConfigurationCreationInfo::create(Target *target) const
{
QTC_ASSERT(factory->canHandle(target), return nullptr);
QTC_ASSERT(id == factory->runConfigurationBaseId(), return nullptr);
if (!factory->canCreateHelper(target, targetName))
return nullptr;
QTC_ASSERT(factory->m_creator, return nullptr);
RunConfiguration *rc = factory->m_creator(target);
if (!rc)
return nullptr;