ProjectExplorer: Simplify BuildManager::buildList() calls

The build list names are always the ones determined from the
build list id. No need to do that on the caller side.

Change-Id: Icc21ef355de535af21215819fe04daa76fed0d9c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
hjk
2018-01-05 15:47:41 +01:00
parent 4b7c82b131
commit a0753d7c34
7 changed files with 16 additions and 20 deletions

View File

@@ -167,7 +167,6 @@ FileName CMakeBuildConfiguration::shadowBuildDirectory(const FileName &projectFi
void CMakeBuildConfiguration::buildTarget(const QString &buildTarget)
{
const Core::Id buildStep = ProjectExplorer::Constants::BUILDSTEPS_BUILD;
const QString name = ProjectExplorer::ProjectExplorerPlugin::displayNameForStepId(buildStep);
CMakeBuildStep *cmBs
= qobject_cast<CMakeBuildStep *>(Utils::findOrDefault(stepList(buildStep)->steps(),
[](const ProjectExplorer::BuildStep *bs) {
@@ -180,7 +179,7 @@ void CMakeBuildConfiguration::buildTarget(const QString &buildTarget)
cmBs->setBuildTarget(buildTarget);
}
BuildManager::buildList(stepList(buildStep), name);
BuildManager::buildList(stepList(buildStep));
if (cmBs)
cmBs->setBuildTarget(originalBuildTarget);

View File

@@ -518,16 +518,19 @@ bool BuildManager::buildQueueAppend(const QList<BuildStep *> &steps, QStringList
return true;
}
bool BuildManager::buildList(BuildStepList *bsl, const QString &stepListName)
bool BuildManager::buildList(BuildStepList *bsl)
{
return buildLists(QList<BuildStepList *>() << bsl, QStringList() << stepListName);
return buildLists({bsl});
}
bool BuildManager::buildLists(QList<BuildStepList *> bsls, const QStringList &stepListNames, const QStringList &preambelMessage)
bool BuildManager::buildLists(QList<BuildStepList *> bsls, const QStringList &preambelMessage)
{
QList<BuildStep *> steps;
foreach (BuildStepList *list, bsls)
QStringList stepListNames;
foreach (BuildStepList *list, bsls) {
steps.append(list->steps());
stepListNames.append(ProjectExplorerPlugin::displayNameForStepId(list->id()));
}
QStringList names;
names.reserve(steps.size());

View File

@@ -50,9 +50,9 @@ public:
static bool isBuilding();
static bool tasksAvailable();
static bool buildLists(QList<BuildStepList *> bsls, const QStringList &stepListNames,
static bool buildLists(QList<BuildStepList *> bsls,
const QStringList &preambelMessage = QStringList());
static bool buildList(BuildStepList *bsl, const QString &stepListName);
static bool buildList(BuildStepList *bsl);
static bool isBuilding(const Project *p);
static bool isBuilding(const Target *t);

View File

@@ -2396,7 +2396,6 @@ int ProjectExplorerPluginPrivate::queue(QList<Project *> projects, QList<Id> ste
}
QList<BuildStepList *> stepLists;
QStringList names;
QStringList preambleMessage;
foreach (Project *pro, projects)
@@ -2417,14 +2416,13 @@ int ProjectExplorerPluginPrivate::queue(QList<Project *> projects, QList<Id> ste
if (!bsl || bsl->isEmpty())
continue;
stepLists << bsl;
names << m_instance->displayNameForStepId(id);
}
}
if (stepLists.isEmpty())
return 0;
if (!BuildManager::buildLists(stepLists, names, preambleMessage))
if (!BuildManager::buildLists(stepLists, preambleMessage))
return -1;
return stepLists.count();
}

View File

@@ -594,8 +594,7 @@ void QbsProjectManagerPlugin::buildFiles(QbsProject *project, const QStringList
const Core::Id buildStep = ProjectExplorer::Constants::BUILDSTEPS_BUILD;
const QString name = ProjectExplorerPlugin::displayNameForStepId(buildStep);
BuildManager::buildList(bc->stepList(buildStep), name);
BuildManager::buildList(bc->stepList(buildStep));
bc->setChangedFiles(QStringList());
bc->setActiveFileTags(QStringList());

View File

@@ -101,8 +101,7 @@ void AndroidQmakeBuildConfiguration::manifestSaved()
qs->setForced(true);
BuildManager::buildList(stepList(ProjectExplorer::Constants::BUILDSTEPS_CLEAN),
ProjectExplorerPlugin::displayNameForStepId(ProjectExplorer::Constants::BUILDSTEPS_CLEAN));
BuildManager::buildList(stepList(ProjectExplorer::Constants::BUILDSTEPS_CLEAN));
BuildManager::appendStep(qs, ProjectExplorerPlugin::displayNameForStepId(ProjectExplorer::Constants::BUILDSTEPS_CLEAN));
setSubNodeBuild(0);
}

View File

@@ -238,11 +238,9 @@ void QmakeManager::handleSubDirContextMenu(QmakeManager::Action action, bool isF
const Core::Id buildStep = ProjectExplorer::Constants::BUILDSTEPS_BUILD;
const Core::Id cleanStep = ProjectExplorer::Constants::BUILDSTEPS_CLEAN;
if (action == BUILD) {
const QString name = ProjectExplorerPlugin::displayNameForStepId(buildStep);
BuildManager::buildList(bc->stepList(buildStep), name);
BuildManager::buildList(bc->stepList(buildStep));
} else if (action == CLEAN) {
const QString name = ProjectExplorerPlugin::displayNameForStepId(cleanStep);
BuildManager::buildList(bc->stepList(cleanStep), name);
BuildManager::buildList(bc->stepList(cleanStep));
} else if (action == REBUILD) {
QStringList names;
names << ProjectExplorerPlugin::displayNameForStepId(cleanStep)