Commit 60a1ee12 authored by dt's avatar dt

Remove project() from BuildStep

The project() should in most cases not matter, instead the
BuildConfiguration should. This shows all the information that needs to
move into the BuildConfiguration classes.
parent 20214787
......@@ -106,10 +106,10 @@ BuildConfiguration *CMakeBuildConfigurationFactory::create(const QString &type)
return false;
BuildConfiguration *bc = new CMakeBuildConfiguration(m_project, buildConfigurationName);
MakeStep *makeStep = new MakeStep(m_project, bc);
MakeStep *makeStep = new MakeStep(bc);
bc->insertBuildStep(0, makeStep);
MakeStep *cleanMakeStep = new MakeStep(m_project, bc);
MakeStep *cleanMakeStep = new MakeStep(bc);
bc->insertCleanStep(0, cleanMakeStep);
cleanMakeStep->setClean(true);
......@@ -671,11 +671,11 @@ bool CMakeProject::restoreSettingsImpl(ProjectExplorer::PersistentSettingsReader
bc->setValue("buildDirectory", copw.buildDirectory());
// Now create a standard build configuration
makeStep = new MakeStep(this, bc);
makeStep = new MakeStep(bc);
bc->insertBuildStep(0, makeStep);
//TODO save arguments somewhere copw.arguments()
MakeStep *cleanMakeStep = new MakeStep(this, bc);
MakeStep *cleanMakeStep = new MakeStep(bc);
bc->insertCleanStep(0, cleanMakeStep);
cleanMakeStep->setClean(true);
setActiveBuildConfiguration(bc);
......
......@@ -42,15 +42,14 @@ using namespace CMakeProjectManager;
using namespace CMakeProjectManager::Internal;
using namespace ProjectExplorer;
MakeStep::MakeStep(CMakeProject *pro, BuildConfiguration *bc)
: AbstractMakeStep(pro, bc), m_pro(pro), m_clean(false), m_futureInterface(0)
MakeStep::MakeStep(BuildConfiguration *bc)
: AbstractMakeStep(bc), m_clean(false), m_futureInterface(0)
{
m_percentProgress = QRegExp("^\\[\\s*(\\d*)%\\]");
}
MakeStep::MakeStep(MakeStep *bs, BuildConfiguration *bc)
: AbstractMakeStep(bs, bc),
m_pro(bs->m_pro),
m_clean(bs->m_clean),
m_futureInterface(0),
m_buildTargets(bs->m_buildTargets),
......@@ -97,17 +96,19 @@ void MakeStep::storeIntoLocalMap(QMap<QString, QVariant> &map)
bool MakeStep::init()
{
BuildConfiguration *bc = buildConfiguration();
setBuildParser(m_pro->buildParser(bc));
// TODO, we should probably have a member cmakeBuildConfiguration();
CMakeProject *pro = static_cast<CMakeProject *>(buildConfiguration()->project());
setBuildParser(pro->buildParser(bc));
setEnabled(true);
setWorkingDirectory(m_pro->buildDirectory(bc));
setWorkingDirectory(pro->buildDirectory(bc));
setCommand(m_pro->toolChain(bc)->makeCommand());
setCommand(pro->toolChain(bc)->makeCommand());
QStringList arguments = m_buildTargets;
arguments << additionalArguments();
setArguments(arguments);
setEnvironment(m_pro->environment(bc));
setEnvironment(pro->environment(bc));
setIgnoreReturnValue(m_clean);
return AbstractMakeStep::init();
......@@ -154,11 +155,6 @@ void MakeStep::stdOut(const QString &line)
AbstractMakeStep::stdOut(line);
}
CMakeProject *MakeStep::project() const
{
return m_pro;
}
bool MakeStep::buildsTarget(const QString &target) const
{
return m_buildTargets.contains(target);
......@@ -277,12 +273,10 @@ bool MakeStepFactory::canCreate(const QString &name) const
return (Constants::MAKESTEP == name);
}
BuildStep *MakeStepFactory::create(Project *project, BuildConfiguration *bc, const QString &name) const
BuildStep *MakeStepFactory::create(BuildConfiguration *bc, const QString &name) const
{
Q_ASSERT(name == Constants::MAKESTEP);
CMakeProject *pro = qobject_cast<CMakeProject *>(project);
Q_ASSERT(pro);
return new MakeStep(pro, bc);
return new MakeStep(bc);
}
BuildStep *MakeStepFactory::clone(BuildStep *bs, BuildConfiguration *bc) const
......
......@@ -49,7 +49,7 @@ class MakeStep : public ProjectExplorer::AbstractMakeStep
friend class MakeStepConfigWidget; // TODO remove
// This is for modifying internal data
public:
MakeStep(CMakeProject *pro, ProjectExplorer::BuildConfiguration *bc);
MakeStep(ProjectExplorer::BuildConfiguration *bc);
MakeStep(MakeStep *bs, ProjectExplorer::BuildConfiguration *bc);
~MakeStep();
virtual bool init();
......@@ -60,7 +60,6 @@ public:
virtual QString displayName();
virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
virtual bool immutable() const;
CMakeProject *project() const;
bool buildsTarget(const QString &target) const;
void setBuildTarget(const QString &target, bool on);
QStringList additionalArguments() const;
......@@ -77,7 +76,6 @@ protected:
// For parsing [ 76%]
virtual void stdOut(const QString &line);
private:
CMakeProject *m_pro;
bool m_clean;
QRegExp m_percentProgress;
QFutureInterface<bool> *m_futureInterface;
......@@ -107,7 +105,7 @@ private:
class MakeStepFactory : public ProjectExplorer::IBuildStepFactory
{
virtual bool canCreate(const QString &name) const;
virtual ProjectExplorer::BuildStep *create(ProjectExplorer::Project *pro, ProjectExplorer::BuildConfiguration *bc, const QString &name) const;
virtual ProjectExplorer::BuildStep *create(ProjectExplorer::BuildConfiguration *bc, const QString &name) const;
virtual ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStep *bs, ProjectExplorer::BuildConfiguration *bc) const;
virtual QStringList canCreateForProject(ProjectExplorer::Project *pro) const;
virtual QString displayNameForName(const QString &name) const;
......
......@@ -47,13 +47,13 @@
using namespace GenericProjectManager;
using namespace GenericProjectManager::Internal;
GenericMakeStep::GenericMakeStep(GenericProject *pro, ProjectExplorer::BuildConfiguration *bc)
: AbstractMakeStep(pro, bc), m_pro(pro)
GenericMakeStep::GenericMakeStep(ProjectExplorer::BuildConfiguration *bc)
: AbstractMakeStep(bc)
{
}
GenericMakeStep::GenericMakeStep(GenericMakeStep *bs, ProjectExplorer::BuildConfiguration *bc)
: AbstractMakeStep(bs, bc), m_pro(bs->project())
: AbstractMakeStep(bs, bc)
{
m_buildTargets = bs->m_buildTargets;
m_makeArguments = bs->m_makeArguments;
......@@ -67,20 +67,21 @@ GenericMakeStep::~GenericMakeStep()
bool GenericMakeStep::init()
{
ProjectExplorer::BuildConfiguration *bc = buildConfiguration();
const QString buildParser = m_pro->buildParser(bc);
//TODO
GenericProject *pro = static_cast<GenericProject *>(buildConfiguration()->project());
const QString buildParser = pro->buildParser(bc);
setBuildParser(buildParser);
qDebug() << "*** build parser:" << buildParser;
setEnabled(true);
Core::VariableManager *vm = Core::VariableManager::instance();
const QString rawBuildDir = m_pro->buildDirectory(bc);
const QString rawBuildDir = buildConfiguration()->project()->buildDirectory(bc);
const QString buildDir = vm->resolve(rawBuildDir);
setWorkingDirectory(buildDir);
setCommand(makeCommand());
setArguments(replacedArguments());
setEnvironment(m_pro->environment(bc));
setEnvironment(buildConfiguration()->project()->environment(bc));
return AbstractMakeStep::init();
}
......@@ -119,7 +120,9 @@ QString GenericMakeStep::makeCommand() const
{
QString command = m_makeCommand;
if (command.isEmpty()) {
if (ProjectExplorer::ToolChain *toolChain = m_pro->toolChain())
// TODO
GenericProject *pro = static_cast<GenericProject *>(buildConfiguration()->project());
if (ProjectExplorer::ToolChain *toolChain = pro->toolChain())
command = toolChain->makeCommand();
else
command = QLatin1String("make");
......@@ -152,11 +155,6 @@ bool GenericMakeStep::immutable() const
return true;
}
GenericProject *GenericMakeStep::project() const
{
return m_pro;
}
bool GenericMakeStep::buildsTarget(const QString &target) const
{
return m_buildTargets.contains(target);
......@@ -184,7 +182,8 @@ GenericMakeStepConfigWidget::GenericMakeStepConfigWidget(GenericMakeStep *makeSt
m_ui->setupUi(this);
// TODO update this list also on rescans of the GenericLists.txt
GenericProject *pro = m_makeStep->project();
//TODO
GenericProject *pro = static_cast<GenericProject *>(m_makeStep->buildConfiguration()->project());
foreach (const QString &target, pro->targets()) {
QListWidgetItem *item = new QListWidgetItem(target, m_ui->targetsList);
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
......@@ -280,14 +279,11 @@ bool GenericMakeStepFactory::canCreate(const QString &name) const
return (Constants::MAKESTEP == name);
}
ProjectExplorer::BuildStep *GenericMakeStepFactory::create(ProjectExplorer::Project *project,
ProjectExplorer::BuildConfiguration *bc,
ProjectExplorer::BuildStep *GenericMakeStepFactory::create(ProjectExplorer::BuildConfiguration *bc,
const QString &name) const
{
Q_ASSERT(name == Constants::MAKESTEP);
GenericProject *pro = qobject_cast<GenericProject *>(project);
Q_ASSERT(pro);
return new GenericMakeStep(pro, bc);
return new GenericMakeStep(bc);
}
ProjectExplorer::BuildStep *GenericMakeStepFactory::clone(ProjectExplorer::BuildStep *bs,
......
......@@ -56,7 +56,7 @@ class GenericMakeStep : public ProjectExplorer::AbstractMakeStep
Q_OBJECT
friend class GenericMakeStepConfigWidget; // TODO remove again?
public:
GenericMakeStep(GenericProject *pro, ProjectExplorer::BuildConfiguration *bc);
GenericMakeStep(ProjectExplorer::BuildConfiguration *bc);
GenericMakeStep(GenericMakeStep *bs, ProjectExplorer::BuildConfiguration *bc);
~GenericMakeStep();
virtual bool init();
......@@ -67,7 +67,6 @@ public:
virtual QString displayName();
virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
virtual bool immutable() const;
GenericProject *project() const;
bool buildsTarget(const QString &target) const;
void setBuildTarget(const QString &target, bool on);
QStringList replacedArguments() const;
......@@ -76,7 +75,6 @@ public:
virtual void restoreFromLocalMap(const QMap<QString, QVariant> &map);
virtual void storeIntoLocalMap(QMap<QString, QVariant> &map);
private:
GenericProject *m_pro;
QStringList m_buildTargets;
QStringList m_makeArguments;
QString m_makeCommand;
......@@ -105,8 +103,7 @@ private:
class GenericMakeStepFactory : public ProjectExplorer::IBuildStepFactory
{
virtual bool canCreate(const QString &name) const;
virtual ProjectExplorer::BuildStep *create(ProjectExplorer::Project *pro,
ProjectExplorer::BuildConfiguration *bc,
virtual ProjectExplorer::BuildStep *create(ProjectExplorer::BuildConfiguration *bc,
const QString &name) const;
virtual ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStep *bs,
ProjectExplorer::BuildConfiguration *bc) const;
......
......@@ -149,7 +149,7 @@ BuildConfiguration *GenericBuildConfigurationFactory::create(const QString &type
GenericBuildConfiguration *bc = new GenericBuildConfiguration(m_project, buildConfigurationName);
m_project->addBuildConfiguration(bc); // also makes the name unique...
GenericMakeStep *makeStep = new GenericMakeStep(m_project, bc);
GenericMakeStep *makeStep = new GenericMakeStep(bc);
bc->insertBuildStep(0, makeStep);
makeStep->setBuildTarget("all", /* on = */ true);
return bc;
......@@ -536,7 +536,7 @@ bool GenericProject::restoreSettingsImpl(ProjectExplorer::PersistentSettingsRead
GenericBuildConfiguration *bc = new GenericBuildConfiguration(this, "all");
addBuildConfiguration(bc);
GenericMakeStep *makeStep = new GenericMakeStep(this, bc);
GenericMakeStep *makeStep = new GenericMakeStep(bc);
bc->insertBuildStep(0, makeStep);
makeStep->setBuildTarget("all", /* on = */ true);
......
......@@ -31,6 +31,7 @@
#include "projectexplorerconstants.h"
#include "project.h"
#include "buildconfiguration.h"
#include <extensionsystem/pluginmanager.h>
#include <utils/qtcassert.h>
......@@ -46,8 +47,8 @@ namespace {
bool debug = false;
}
AbstractMakeStep::AbstractMakeStep(Project *project, BuildConfiguration *bc)
: AbstractProcessStep(project, bc),
AbstractMakeStep::AbstractMakeStep(BuildConfiguration *bc)
: AbstractProcessStep(bc),
m_buildParser(0)
{
}
......@@ -144,7 +145,7 @@ void AbstractMakeStep::slotAddToTaskWindow(const TaskWindow::Task &task)
if (debug)
qDebug() << "No success. Trying all files in project ...";
QString fileName = QFileInfo(filePath).fileName();
foreach (const QString &file, project()->files(ProjectExplorer::Project::AllFiles)) {
foreach (const QString &file, buildConfiguration()->project()->files(ProjectExplorer::Project::AllFiles)) {
QFileInfo candidate(file);
if (candidate.fileName() == fileName) {
if (debug)
......
......@@ -46,7 +46,7 @@ class PROJECTEXPLORER_EXPORT AbstractMakeStep : public ProjectExplorer::Abstract
{
Q_OBJECT
public:
AbstractMakeStep(Project * project, BuildConfiguration *bc);
AbstractMakeStep(BuildConfiguration *bc);
AbstractMakeStep(AbstractMakeStep *bs, BuildConfiguration *bc);
~AbstractMakeStep();
virtual bool init();
......
......@@ -39,8 +39,8 @@
using namespace ProjectExplorer;
AbstractProcessStep::AbstractProcessStep(Project *pro, BuildConfiguration *bc)
: BuildStep(pro, bc), m_timer(0), m_futureInterface(0), m_process(0), m_eventLoop(0)
AbstractProcessStep::AbstractProcessStep(BuildConfiguration *bc)
: BuildStep(bc), m_timer(0), m_futureInterface(0), m_process(0), m_eventLoop(0)
{
}
......
......@@ -65,7 +65,7 @@ class PROJECTEXPLORER_EXPORT AbstractProcessStep : public BuildStep
{
Q_OBJECT
public:
AbstractProcessStep(Project *pro, BuildConfiguration *bc);
AbstractProcessStep(BuildConfiguration *bc);
AbstractProcessStep(AbstractProcessStep *bs, BuildConfiguration *bc);
/// reimplemented from BuildStep::init()
/// You need to call this from YourBuildStep::init()
......
......@@ -136,7 +136,7 @@ void BuildManager::cancel()
this, SLOT(addToTaskWindow(ProjectExplorer::TaskWindow::Task)));
disconnect(m_currentBuildStep, SIGNAL(addToOutputWindow(QString)),
this, SLOT(addToOutputWindow(QString)));
decrementActiveBuildSteps(m_currentBuildStep->project());
decrementActiveBuildSteps(m_currentBuildStep->buildConfiguration()->project());
m_progressFutureInterface->setProgressValueAndText(m_progress*100, "Build canceled"); //TODO NBS fix in qtconcurrent
clearBuildQueue();
......@@ -169,7 +169,7 @@ void BuildManager::emitCancelMessage()
void BuildManager::clearBuildQueue()
{
foreach (BuildStep * bs, m_buildQueue)
decrementActiveBuildSteps(bs->project());
decrementActiveBuildSteps(bs->buildConfiguration()->project());
m_buildQueue.clear();
m_running = false;
......@@ -280,13 +280,14 @@ void BuildManager::nextBuildQueue()
bool result = m_watcher.result();
if (!result) {
// Build Failure
addToOutputWindow(tr("<font color=\"#ff0000\">Error while building project %1</font>").arg(m_currentBuildStep->project()->name()));
const QString projectName = m_currentBuildStep->buildConfiguration()->project()->name();
addToOutputWindow(tr("<font color=\"#ff0000\">Error while building project %1</font>").arg(projectName));
addToOutputWindow(tr("<font color=\"#ff0000\">When executing build step '%1'</font>").arg(m_currentBuildStep->displayName()));
// NBS TODO fix in qtconcurrent
m_progressFutureInterface->setProgressValueAndText(m_progress*100, tr("Error while building project %1").arg(m_currentBuildStep->project()->name()));
m_progressFutureInterface->setProgressValueAndText(m_progress*100, tr("Error while building project %1").arg(projectName));
}
decrementActiveBuildSteps(m_currentBuildStep->project());
decrementActiveBuildSteps(m_currentBuildStep->buildConfiguration()->project());
if (result)
nextStep();
else
......@@ -317,17 +318,18 @@ void BuildManager::nextStep()
bool init = m_currentBuildStep->init();
if (!init) {
addToOutputWindow(tr("<font color=\"#ff0000\">Error while building project %1</font>").arg(m_currentBuildStep->project()->name()));
const QString projectName = m_currentBuildStep->buildConfiguration()->project()->name();
addToOutputWindow(tr("<font color=\"#ff0000\">Error while building project %1</font>").arg(projectName));
addToOutputWindow(tr("<font color=\"#ff0000\">When executing build step '%1'</font>").arg(m_currentBuildStep->displayName()));
cancel();
return;
}
if (m_currentBuildStep->project() != m_previousBuildStepProject) {
const QString projectName = m_currentBuildStep->project()->name();
if (m_currentBuildStep->buildConfiguration()->project() != m_previousBuildStepProject) {
const QString projectName = m_currentBuildStep->buildConfiguration()->project()->name();
addToOutputWindow(tr("<b>Running build steps for project %2...</b>")
.arg(projectName));
m_previousBuildStepProject = m_currentBuildStep->project();
m_previousBuildStepProject = m_currentBuildStep->buildConfiguration()->project();
}
m_watcher.setFuture(QtConcurrent::run(&BuildStep::run, m_currentBuildStep));
} else {
......@@ -346,7 +348,7 @@ void BuildManager::buildQueueAppend(BuildStep * bs)
{
m_buildQueue.append(bs);
++m_maxProgress;
incrementActiveBuildSteps(bs->project());
incrementActiveBuildSteps(bs->buildConfiguration()->project());
}
void BuildManager::buildProjects(const QList<Project *> &projects, const QList<QString> &configurations)
......
......@@ -36,13 +36,13 @@
using namespace ProjectExplorer;
BuildStep::BuildStep(Project * pro, BuildConfiguration *bc)
: m_project(pro), m_buildConfiguration(bc)
BuildStep::BuildStep(BuildConfiguration *bc)
: m_buildConfiguration(bc)
{
}
BuildStep::BuildStep(BuildStep *bs, BuildConfiguration *bc)
: m_project(bs->m_project), m_buildConfiguration(bc)
: m_buildConfiguration(bc)
{
}
......@@ -68,11 +68,6 @@ void BuildStep::storeIntoLocalMap(QMap<QString, QVariant> &map)
Q_UNUSED(map)
}
Project *BuildStep::project() const
{
return m_project;
}
BuildConfiguration *BuildStep::buildConfiguration() const
{
return m_buildConfiguration;
......
......@@ -37,7 +37,7 @@
#include <QtCore/QFutureInterface>
namespace ProjectExplorer {
// TODO remove this
class Project;
class BuildConfiguration;
......@@ -71,9 +71,8 @@ class BuildStepConfigWidget;
class PROJECTEXPLORER_EXPORT BuildStep : public QObject
{
Q_OBJECT
friend class Project; //for managing BuildConfigurations
protected:
BuildStep(Project *p, BuildConfiguration *bc);
BuildStep(BuildConfiguration *bc);
BuildStep(BuildStep *bs, BuildConfiguration *bc);
public:
......@@ -110,7 +109,6 @@ public:
virtual void restoreFromLocalMap(const QMap<QString, QVariant> &map);
virtual void storeIntoLocalMap(QMap<QString, QVariant> &map);
Project *project() const;
BuildConfiguration *buildConfiguration() const;
Q_SIGNALS:
......@@ -120,7 +118,6 @@ Q_SIGNALS:
void addToOutputWindow(const QString &string);
private:
Project *m_project;
BuildConfiguration *m_buildConfiguration;
};
......@@ -135,7 +132,7 @@ public:
/// Called to check wheter this factory can restore the named BuildStep
virtual bool canCreate(const QString &name) const = 0;
/// Called to restore a buildstep
virtual BuildStep *create(Project *pro, BuildConfiguration *bc, const QString &name) const = 0;
virtual BuildStep *create(BuildConfiguration *bc, const QString &name) const = 0;
/// Called by the add BuildStep action to check which BuildSteps could be added
/// to the project by this factory, should return a list of names
virtual QStringList canCreateForProject(Project *pro) const = 0;
......
......@@ -216,7 +216,7 @@ void BuildStepsPage::addBuildStep()
if (QAction *action = qobject_cast<QAction *>(sender())) {
BuildConfiguration *bc = m_pro->buildConfiguration(m_configuration);
QPair<QString, IBuildStepFactory *> pair = m_addBuildStepHash.value(action);
BuildStep *newStep = pair.second->create(m_pro, bc, pair.first);
BuildStep *newStep = pair.second->create(bc, pair.first);
int pos = m_clean ? bc->cleanSteps().count() : bc->buildSteps().count();
m_clean ? bc->insertCleanStep(pos, newStep) : bc->insertBuildStep(pos, newStep);
......
......@@ -30,6 +30,7 @@
#include "processstep.h"
#include "buildstep.h"
#include "project.h"
#include "buildconfiguration.h"
#include <coreplugin/ifile.h>
#include <utils/qtcassert.h>
......@@ -45,8 +46,8 @@ static const char * const PROCESS_WORKINGDIRECTORY = "abstractProcess.workingDir
static const char * const PROCESS_ARGUMENTS = "abstractProcess.arguments";
static const char * const PROCESS_ENABLED = "abstractProcess.enabled";
ProcessStep::ProcessStep(Project *pro, BuildConfiguration *bc)
: AbstractProcessStep(pro, bc)
ProcessStep::ProcessStep(BuildConfiguration *bc)
: AbstractProcessStep(bc)
{
}
......@@ -64,12 +65,12 @@ ProcessStep::ProcessStep(ProcessStep *bs, BuildConfiguration *bc)
bool ProcessStep::init()
{
setEnvironment(project()->environment(buildConfiguration()));
setEnvironment(buildConfiguration()->project()->environment(buildConfiguration()));
QString wd = workingDirectory();
if (wd.isEmpty())
wd = "$BUILDDIR";
AbstractProcessStep::setWorkingDirectory(wd.replace("$BUILDDIR", project()->buildDirectory(buildConfiguration())));
AbstractProcessStep::setWorkingDirectory(wd.replace("$BUILDDIR", buildConfiguration()->project()->buildDirectory(buildConfiguration())));
AbstractProcessStep::setCommand(m_command);
AbstractProcessStep::setEnabled(m_enabled);
AbstractProcessStep::setArguments(m_arguments);
......@@ -200,10 +201,10 @@ bool ProcessStepFactory::canCreate(const QString &name) const
return name == "projectexplorer.processstep";
}
BuildStep *ProcessStepFactory::create(Project *pro, BuildConfiguration *bc, const QString &name) const
BuildStep *ProcessStepFactory::create(BuildConfiguration *bc, const QString &name) const
{
Q_UNUSED(name)
return new ProcessStep(pro, bc);
return new ProcessStep(bc);
}
BuildStep *ProcessStepFactory::clone(BuildStep *bs, BuildConfiguration *bc) const
......
......@@ -45,7 +45,7 @@ class ProcessStepFactory : public IBuildStepFactory
public:
ProcessStepFactory();
virtual bool canCreate(const QString &name) const;
virtual BuildStep *create(Project *pro, BuildConfiguration *bc, const QString &name) const;
virtual BuildStep *create(BuildConfiguration *bc, const QString &name) const;
virtual BuildStep *clone(BuildStep *bs, BuildConfiguration *bc) const;
virtual QStringList canCreateForProject(Project *pro) const;
virtual QString displayNameForName(const QString &name) const;
......@@ -55,7 +55,7 @@ class ProcessStep : public ProjectExplorer::AbstractProcessStep
{
Q_OBJECT
public:
ProcessStep(Project *pro, BuildConfiguration *bc);
ProcessStep(BuildConfiguration *bc);
ProcessStep(ProcessStep *bs, BuildConfiguration *bc);
virtual bool init();
virtual void run(QFutureInterface<bool> &);
......
......@@ -238,7 +238,7 @@ bool Project::restoreSettingsImpl(PersistentSettingsReader &reader)
BuildStep *buildStep = 0;
foreach (IBuildStepFactory *factory, buildStepFactories) {
if (factory->canCreate(buildStepName)) {
buildStep = factory->create(this, bc, buildStepName);
buildStep = factory->create(bc, buildStepName);
break;
}
}
......@@ -265,7 +265,7 @@ bool Project::restoreSettingsImpl(PersistentSettingsReader &reader)
BuildStep *cleanStep = 0;
foreach (IBuildStepFactory *factory, buildStepFactories) {
if (factory->canCreate(cleanStepName)) {
cleanStep = factory->create(this, bc, cleanStepName);
cleanStep = factory->create(bc, cleanStepName);
break;
}
}
......@@ -303,7 +303,7 @@ bool Project::restoreSettingsImpl(PersistentSettingsReader &reader)
}
if (factory) {
foreach(BuildConfiguration *bc, buildConfigurations()) {
buildStep = factory->create(this, bc, buildStepName);
buildStep = factory->create(bc, buildStepName);
bc->insertBuildStep(pos, buildStep);
QMap<QString, QVariant> buildStepValues = reader.restoreValue("buildstep" + QString().setNum(buildstepnr)).toMap();
buildStep->restoreFromGlobalMap(buildStepValues);
......@@ -335,7 +335,7 @@ bool Project::restoreSettingsImpl(PersistentSettingsReader &reader)
if (factory) {
foreach(BuildConfiguration *bc, buildConfigurations()) {
cleanStep = factory->create(this, bc, cleanStepName);
cleanStep = factory->create(bc, cleanStepName);
bc->insertCleanStep(pos, cleanStep);
QMap<QString, QVariant> cleanStepValues = reader.restoreValue("cleanstep" + QString().setNum(cleanstepnr)).toMap();
cleanStep->restoreFromGlobalMap(cleanStepValues);
......
......@@ -44,8 +44,8 @@ using ExtensionSystem::PluginManager;
using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
MakeStep::MakeStep(Qt4Project * project, ProjectExplorer::BuildConfiguration *bc)
: AbstractMakeStep(project, bc), m_clean(false)
MakeStep::MakeStep(ProjectExplorer::BuildConfiguration *bc)
: AbstractMakeStep(bc), m_clean(false)
{
}
......@@ -97,10 +97,11 @@ void MakeStep::storeIntoLocalMap(QMap<QString, QVariant> &map)
bool MakeStep::init()
{
ProjectExplorer::BuildConfiguration *bc = buildConfiguration();
Environment environment = project()->environment(bc);
Environment environment = buildConfiguration()->project()->environment(bc);
setEnvironment(environment);
Qt4Project *qt4project = qobject_cast<Qt4Project *>(project());
//TODO
Qt4Project *qt4project = static_cast<Qt4Project *>(buildConfiguration()->project());
QString workingDirectory = qt4project->buildDirectory(bc);
setWorkingDirectory(workingDirectory);
......@@ -163,7 +164,7 @@ bool MakeStep::init()
void MakeStep::run(QFutureInterface<bool> & fi)
{
if (qobject_cast<Qt4Project *>(project())->rootProjectNode()->projectType() == ScriptTemplate) {
if (static_cast<Qt4Project *>(buildConfiguration()->project())->rootProjectNode()->projectType() == ScriptTemplate) {