forked from qt-creator/qt-creator
ProjectExplorer: Make it easier to use RunConfiguration ids
... in RunWorkerFactory. The semantics is the same as in the other
{RunConfiguration,BuildConfiguration,...}Factory::addSupportedFoo
cases: As long as none is specified, there's no constraint, if
there are any, it's a whitelist.
Change-Id: Ia05afd9afe6886e4bacc58ac786f2548f03e5ca8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -87,6 +87,11 @@ bool RunWorkerFactory::canRun(RunConfiguration *runConfiguration, Core::Id runMo
|
||||
if (!m_supportedRunModes.contains(runMode))
|
||||
return false;
|
||||
|
||||
if (!m_supportedRunConfigurations.isEmpty()) {
|
||||
if (!m_supportedRunConfigurations.contains(runConfiguration->id()))
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const Constraint &constraint : m_constraints) {
|
||||
if (!constraint(runConfiguration))
|
||||
return false;
|
||||
@@ -115,6 +120,16 @@ void RunWorkerFactory::addSupportedRunMode(Core::Id runMode)
|
||||
m_supportedRunModes.append(runMode);
|
||||
}
|
||||
|
||||
void RunWorkerFactory::setSupportedRunConfigurations(const QList<Core::Id> &ids)
|
||||
{
|
||||
m_supportedRunConfigurations = ids;
|
||||
}
|
||||
|
||||
void RunWorkerFactory::addSupportedRunConfiguration(Core::Id id)
|
||||
{
|
||||
m_supportedRunConfigurations.append(id);
|
||||
}
|
||||
|
||||
void RunWorkerFactory::destroyRemainingRunWorkerFactories()
|
||||
{
|
||||
qDeleteAll(g_runWorkerFactories);
|
||||
|
||||
Reference in New Issue
Block a user