forked from qt-creator/qt-creator
ProjectExplorer: Add RunConfigFactory::addRunWorkerFactory convienience
There is a recurring special case that certain run controls depend on the presence of specific RunConfiguration (which in turn has it's own restriction on e.g. target or project types) but have no further restrictions. Make it easy to handle that case. Change-Id: I2e86f366591b02003f720dcc00b4c52bb2f34e00 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -520,6 +520,8 @@ RunConfigurationFactory::RunConfigurationFactory()
|
||||
RunConfigurationFactory::~RunConfigurationFactory()
|
||||
{
|
||||
g_runConfigurationFactories.removeOne(this);
|
||||
qDeleteAll(m_ownedRunWorkerFactories);
|
||||
m_ownedRunWorkerFactories.clear();
|
||||
}
|
||||
|
||||
QString RunConfigurationFactory::decoratedTargetName(const QString targetName, Target *target)
|
||||
@@ -586,6 +588,16 @@ void RunConfigurationFactory::setDecorateDisplayNames(bool on)
|
||||
m_decorateDisplayNames = on;
|
||||
}
|
||||
|
||||
RunWorkerFactory *RunConfigurationFactory::addRunWorkerFactoryHelper
|
||||
(Core::Id runMode, const std::function<RunWorker *(RunControl *)> &creator)
|
||||
{
|
||||
auto factory = new RunWorkerFactory;
|
||||
factory->addConstraint(m_ownTypeChecker);
|
||||
factory->addSupportedRunMode(runMode);
|
||||
factory->setProducer(creator);
|
||||
return factory;
|
||||
}
|
||||
|
||||
void RunConfigurationFactory::addSupportedProjectType(Core::Id id)
|
||||
{
|
||||
m_supportedProjectTypes.append(id);
|
||||
|
||||
Reference in New Issue
Block a user