forked from qt-creator/qt-creator
ProjectExplorer: Simplify collection of RunConfigurationCreationInfos
Instead of calling twice for AutoCreated and UserCreated, call once and record to which case it belongs. Only the 'both' and 'user only' combination are ever used. Change-Id: I9c15085bcbb4bf6584a6156135f2084dbfc51c1c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -52,22 +52,11 @@ IosRunConfigurationFactory::IosRunConfigurationFactory(QObject *parent)
|
||||
}
|
||||
|
||||
QList<RunConfigurationCreationInfo>
|
||||
IosRunConfigurationFactory::availableCreators(Target *parent, CreationMode mode) const
|
||||
IosRunConfigurationFactory::availableCreators(Target *parent) const
|
||||
{
|
||||
auto project = static_cast<QmakeProject *>(parent->project());
|
||||
return Utils::transform(project->buildTargets(mode, {ProjectType::ApplicationTemplate,
|
||||
ProjectType::SharedLibraryTemplate}),
|
||||
[this](const BuildTargetInfo &ti) { return convert(ti); });
|
||||
}
|
||||
|
||||
bool IosRunConfigurationFactory::canCreateHelper(Target *parent, const QString &buildTarget) const
|
||||
{
|
||||
auto project = static_cast<QmakeProject *>(parent->project());
|
||||
const QList<BuildTargetInfo> buildTargets = project->buildTargets(UserCreate, {ProjectType::ApplicationTemplate,
|
||||
ProjectType::SharedLibraryTemplate});
|
||||
return Utils::contains(buildTargets, [buildTarget](const BuildTargetInfo &bti) {
|
||||
return bti.targetName == buildTarget;
|
||||
});
|
||||
return project->runConfigurationCreators(this, {ProjectType::ApplicationTemplate,
|
||||
ProjectType::SharedLibraryTemplate});
|
||||
}
|
||||
|
||||
bool IosRunConfigurationFactory::hasRunConfigForProFile(RunConfiguration *rc, const Utils::FileName &n) const
|
||||
|
||||
Reference in New Issue
Block a user