Commit 8ccbd0ec authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Rename StepType to BuildStep::Type

 * Move and rename the enum
 * Add Q_ENUMS macro

Reviewed-by: dt
parent 7fa5d25e
......@@ -211,10 +211,10 @@ CMakeBuildConfiguration *CMakeBuildConfigurationFactory::create(ProjectExplorer:
bc->setDisplayName(buildConfigurationName);
MakeStep *makeStep = new MakeStep(bc);
bc->insertStep(ProjectExplorer::Build, 0, makeStep);
bc->insertStep(ProjectExplorer::BuildStep::Build, 0, makeStep);
MakeStep *cleanMakeStep = new MakeStep(bc);
bc->insertStep(ProjectExplorer::Clean, 0, cleanMakeStep);
bc->insertStep(ProjectExplorer::BuildStep::Clean, 0, cleanMakeStep);
cleanMakeStep->setAdditionalArguments(QStringList() << "clean");
cleanMakeStep->setClean(true);
......
......@@ -521,7 +521,7 @@ bool CMakeProject::fromMap(const QVariantMap &map)
if (!hasUserFile && hasBuildTarget("all")) {
MakeStep *makeStep = qobject_cast<MakeStep *>(
activeTarget()->activeBuildConfiguration()->steps(ProjectExplorer::Build).at(0));
activeTarget()->activeBuildConfiguration()->steps(ProjectExplorer::BuildStep::Build).at(0));
Q_ASSERT(makeStep);
makeStep->setBuildTarget("all", true);
}
......
......@@ -188,10 +188,10 @@ CMakeTarget *CMakeTargetFactory::create(ProjectExplorer::Project *parent, const
bc->setDisplayName("all");
// Now create a standard build configuration
bc->insertStep(ProjectExplorer::Build, 0, new MakeStep(bc));
bc->insertStep(ProjectExplorer::BuildStep::Build, 0, new MakeStep(bc));
MakeStep *cleanMakeStep = new MakeStep(bc);
bc->insertStep(ProjectExplorer::Clean, 0, cleanMakeStep);
bc->insertStep(ProjectExplorer::BuildStep::Clean, 0, cleanMakeStep);
cleanMakeStep->setAdditionalArguments(QStringList() << "clean");
cleanMakeStep->setClean(true);
......
......@@ -317,7 +317,7 @@ MakeStepFactory::~MakeStepFactory()
{
}
bool MakeStepFactory::canCreate(BuildConfiguration *parent, ProjectExplorer::StepType type, const QString &id) const
bool MakeStepFactory::canCreate(BuildConfiguration *parent, ProjectExplorer::BuildStep::Type type, const QString &id) const
{
Q_UNUSED(type)
if (!qobject_cast<CMakeBuildConfiguration *>(parent))
......@@ -325,32 +325,32 @@ bool MakeStepFactory::canCreate(BuildConfiguration *parent, ProjectExplorer::Ste
return QLatin1String(MS_ID) == id;
}
BuildStep *MakeStepFactory::create(BuildConfiguration *parent, ProjectExplorer::StepType type, const QString &id)
BuildStep *MakeStepFactory::create(BuildConfiguration *parent, ProjectExplorer::BuildStep::Type type, const QString &id)
{
if (!canCreate(parent, type, id))
return 0;
return new MakeStep(parent);
}
bool MakeStepFactory::canClone(BuildConfiguration *parent, ProjectExplorer::StepType type, BuildStep *source) const
bool MakeStepFactory::canClone(BuildConfiguration *parent, ProjectExplorer::BuildStep::Type type, BuildStep *source) const
{
return canCreate(parent, type, source->id());
}
BuildStep *MakeStepFactory::clone(BuildConfiguration *parent, ProjectExplorer::StepType type, BuildStep *source)
BuildStep *MakeStepFactory::clone(BuildConfiguration *parent, ProjectExplorer::BuildStep::Type type, BuildStep *source)
{
if (!canClone(parent, type, source))
return 0;
return new MakeStep(parent, static_cast<MakeStep *>(source));
}
bool MakeStepFactory::canRestore(BuildConfiguration *parent, ProjectExplorer::StepType type, const QVariantMap &map) const
bool MakeStepFactory::canRestore(BuildConfiguration *parent, ProjectExplorer::BuildStep::Type type, const QVariantMap &map) const
{
QString id(ProjectExplorer::idFromMap(map));
return canCreate(parent, type, id);
}
BuildStep *MakeStepFactory::restore(BuildConfiguration *parent, ProjectExplorer::StepType type, const QVariantMap &map)
BuildStep *MakeStepFactory::restore(BuildConfiguration *parent, ProjectExplorer::BuildStep::Type type, const QVariantMap &map)
{
if (!canRestore(parent, type, map))
return 0;
......@@ -361,7 +361,7 @@ BuildStep *MakeStepFactory::restore(BuildConfiguration *parent, ProjectExplorer:
return 0;
}
QStringList MakeStepFactory::availableCreationIds(ProjectExplorer::BuildConfiguration *parent, ProjectExplorer::StepType type) const
QStringList MakeStepFactory::availableCreationIds(ProjectExplorer::BuildConfiguration *parent, ProjectExplorer::BuildStep::Type type) const
{
Q_UNUSED(type)
if (!qobject_cast<CMakeBuildConfiguration *>(parent))
......
......@@ -119,14 +119,14 @@ public:
explicit MakeStepFactory(QObject *parent = 0);
virtual ~MakeStepFactory();
virtual bool canCreate(ProjectExplorer::BuildConfiguration *parent, ProjectExplorer::StepType type, const QString &id) const;
virtual ProjectExplorer::BuildStep *create(ProjectExplorer::BuildConfiguration *parent, ProjectExplorer::StepType type, const QString &id);
virtual bool canClone(ProjectExplorer::BuildConfiguration *parent, ProjectExplorer::StepType type, ProjectExplorer::BuildStep *source) const;
virtual ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildConfiguration *parent, ProjectExplorer::StepType type, ProjectExplorer::BuildStep *source);
virtual bool canRestore(ProjectExplorer::BuildConfiguration *parent, ProjectExplorer::StepType type, const QVariantMap &map) const;
virtual ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildConfiguration *parent, ProjectExplorer::StepType type, const QVariantMap &map);
virtual QStringList availableCreationIds(ProjectExplorer::BuildConfiguration *bc, ProjectExplorer::StepType type) const;
virtual bool canCreate(ProjectExplorer::BuildConfiguration *parent, ProjectExplorer::BuildStep::Type type, const QString &id) const;
virtual ProjectExplorer::BuildStep *create(ProjectExplorer::BuildConfiguration *parent, ProjectExplorer::BuildStep::Type type, const QString &id);
virtual bool canClone(ProjectExplorer::BuildConfiguration *parent, ProjectExplorer::BuildStep::Type type, ProjectExplorer::BuildStep *source) const;
virtual ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildConfiguration *parent, ProjectExplorer::BuildStep::Type type, ProjectExplorer::BuildStep *source);
virtual bool canRestore(ProjectExplorer::BuildConfiguration *parent, ProjectExplorer::BuildStep::Type type, const QVariantMap &map) const;
virtual ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildConfiguration *parent, ProjectExplorer::BuildStep::Type type, const QVariantMap &map);
virtual QStringList availableCreationIds(ProjectExplorer::BuildConfiguration *bc, ProjectExplorer::BuildStep::Type type) const;
virtual QString displayNameForId(const QString &id) const;
};
......
......@@ -174,7 +174,7 @@ BuildConfiguration *GenericBuildConfigurationFactory::create(ProjectExplorer::Ta
bc->setDisplayName(buildConfigurationName);
GenericMakeStep *makeStep = new GenericMakeStep(bc);
bc->insertStep(ProjectExplorer::Build, 0, makeStep);
bc->insertStep(ProjectExplorer::BuildStep::Build, 0, makeStep);
makeStep->setBuildTarget("all", /* on = */ true);
target->addBuildConfiguration(bc); // also makes the name unique...
......
......@@ -308,7 +308,7 @@ GenericMakeStepFactory::~GenericMakeStepFactory()
}
bool GenericMakeStepFactory::canCreate(ProjectExplorer::BuildConfiguration *parent,
ProjectExplorer::StepType type,
ProjectExplorer::BuildStep::Type type,
const QString &id) const
{
Q_UNUSED(type)
......@@ -318,7 +318,7 @@ bool GenericMakeStepFactory::canCreate(ProjectExplorer::BuildConfiguration *pare
}
ProjectExplorer::BuildStep *GenericMakeStepFactory::create(ProjectExplorer::BuildConfiguration *parent,
ProjectExplorer::StepType type,
ProjectExplorer::BuildStep::Type type,
const QString &id)
{
if (!canCreate(parent, type, id))
......@@ -327,7 +327,7 @@ ProjectExplorer::BuildStep *GenericMakeStepFactory::create(ProjectExplorer::Buil
}
bool GenericMakeStepFactory::canClone(ProjectExplorer::BuildConfiguration *parent,
ProjectExplorer::StepType type,
ProjectExplorer::BuildStep::Type type,
ProjectExplorer::BuildStep *source) const
{
const QString id(source->id());
......@@ -335,7 +335,7 @@ bool GenericMakeStepFactory::canClone(ProjectExplorer::BuildConfiguration *paren
}
ProjectExplorer::BuildStep *GenericMakeStepFactory::clone(ProjectExplorer::BuildConfiguration *parent,
ProjectExplorer::StepType type,
ProjectExplorer::BuildStep::Type type,
ProjectExplorer::BuildStep *source)
{
if (!canClone(parent, type, source))
......@@ -346,7 +346,7 @@ ProjectExplorer::BuildStep *GenericMakeStepFactory::clone(ProjectExplorer::Build
}
bool GenericMakeStepFactory::canRestore(ProjectExplorer::BuildConfiguration *parent,
ProjectExplorer::StepType type,
ProjectExplorer::BuildStep::Type type,
const QVariantMap &map) const
{
QString id(ProjectExplorer::idFromMap(map));
......@@ -354,7 +354,7 @@ bool GenericMakeStepFactory::canRestore(ProjectExplorer::BuildConfiguration *par
}
ProjectExplorer::BuildStep *GenericMakeStepFactory::restore(ProjectExplorer::BuildConfiguration *parent,
ProjectExplorer::StepType type,
ProjectExplorer::BuildStep::Type type,
const QVariantMap &map)
{
if (!canRestore(parent, type, map))
......@@ -367,7 +367,7 @@ ProjectExplorer::BuildStep *GenericMakeStepFactory::restore(ProjectExplorer::Bui
}
QStringList GenericMakeStepFactory::availableCreationIds(ProjectExplorer::BuildConfiguration *parent,
ProjectExplorer::StepType type) const
ProjectExplorer::BuildStep::Type type) const
{
Q_UNUSED(type)
if (!qobject_cast<GenericBuildConfiguration *>(parent))
......
......@@ -114,26 +114,26 @@ public:
virtual ~GenericMakeStepFactory();
virtual bool canCreate(ProjectExplorer::BuildConfiguration *parent,
ProjectExplorer::StepType type,
ProjectExplorer::BuildStep::Type type,
const QString &id) const;
virtual ProjectExplorer::BuildStep *create(ProjectExplorer::BuildConfiguration *parent,
ProjectExplorer::StepType type,
ProjectExplorer::BuildStep::Type type,
const QString &id);
virtual bool canClone(ProjectExplorer::BuildConfiguration *parent,
ProjectExplorer::StepType type,
ProjectExplorer::BuildStep::Type type,
ProjectExplorer::BuildStep *source) const;
virtual ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildConfiguration *parent,
ProjectExplorer::StepType type,
ProjectExplorer::BuildStep::Type type,
ProjectExplorer::BuildStep *source);
virtual bool canRestore(ProjectExplorer::BuildConfiguration *parent,
ProjectExplorer::StepType type,
ProjectExplorer::BuildStep::Type type,
const QVariantMap &map) const;
virtual ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildConfiguration *parent,
ProjectExplorer::StepType type,
ProjectExplorer::BuildStep::Type type,
const QVariantMap &map);
virtual QStringList availableCreationIds(ProjectExplorer::BuildConfiguration *bc,
ProjectExplorer::StepType type) const;
ProjectExplorer::BuildStep::Type type) const;
virtual QString displayNameForId(const QString &id) const;
};
......
......@@ -137,7 +137,7 @@ GenericTarget *GenericTargetFactory::create(ProjectExplorer::Project *parent, co
bc->setDisplayName("all");
GenericMakeStep *makeStep = new GenericMakeStep(bc);
bc->insertStep(ProjectExplorer::Build, 0, makeStep);
bc->insertStep(ProjectExplorer::BuildStep::Build, 0, makeStep);
makeStep->setBuildTarget("all", /* on = */ true);
......
......@@ -41,7 +41,7 @@ using namespace ProjectExplorer;
namespace {
IBuildStepFactory *findCloneFactory(BuildConfiguration *parent, StepType type, BuildStep *source)
IBuildStepFactory *findCloneFactory(BuildConfiguration *parent, BuildStep::Type type, BuildStep *source)
{
QList<IBuildStepFactory *> factories = ExtensionSystem::PluginManager::instance()->getObjects<IBuildStepFactory>();
foreach(IBuildStepFactory *factory, factories)
......@@ -50,7 +50,7 @@ IBuildStepFactory *findCloneFactory(BuildConfiguration *parent, StepType type, B
return 0;
}
IBuildStepFactory *findRestoreFactory(BuildConfiguration *parent, StepType type, const QVariantMap &map)
IBuildStepFactory *findRestoreFactory(BuildConfiguration *parent, BuildStep::Type type, const QVariantMap &map)
{
QList<IBuildStepFactory *> factories = ExtensionSystem::PluginManager::instance()->getObjects<IBuildStepFactory>();
foreach(IBuildStepFactory *factory, factories)
......@@ -87,7 +87,7 @@ BuildConfiguration::BuildConfiguration(Target *target, BuildConfiguration *sourc
BuildConfiguration::~BuildConfiguration()
{
for (int i = 0; i < LastStepType; ++i) {
for (int i = 0; i < BuildStep::LastStepType; ++i) {
qDeleteAll(m_steps[i]);
}
}
......@@ -95,12 +95,12 @@ BuildConfiguration::~BuildConfiguration()
QVariantMap BuildConfiguration::toMap() const
{
QVariantMap map(ProjectConfiguration::toMap());
map.insert(QLatin1String(BUILD_STEPS_COUNT_KEY), m_steps[Build].count());
for (int i = 0; i < m_steps[Build].count(); ++i)
map.insert(QString::fromLatin1(BUILD_STEPS_PREFIX) + QString::number(i), m_steps[Build].at(i)->toMap());
map.insert(QLatin1String(CLEAN_STEPS_COUNT_KEY), m_steps[Clean].count());
for (int i = 0; i < m_steps[Clean].count(); ++i)
map.insert(QString::fromLatin1(CLEAN_STEPS_PREFIX) + QString::number(i), m_steps[Clean].at(i)->toMap());
map.insert(QLatin1String(BUILD_STEPS_COUNT_KEY), m_steps[BuildStep::Build].count());
for (int i = 0; i < m_steps[BuildStep::Build].count(); ++i)
map.insert(QString::fromLatin1(BUILD_STEPS_PREFIX) + QString::number(i), m_steps[BuildStep::Build].at(i)->toMap());
map.insert(QLatin1String(CLEAN_STEPS_COUNT_KEY), m_steps[BuildStep::Clean].count());
for (int i = 0; i < m_steps[BuildStep::Clean].count(); ++i)
map.insert(QString::fromLatin1(CLEAN_STEPS_PREFIX) + QString::number(i), m_steps[BuildStep::Clean].at(i)->toMap());
map.insert(QLatin1String(CLEAR_SYSTEM_ENVIRONMENT_KEY), m_clearSystemEnvironment);
map.insert(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY), EnvironmentItem::toStringList(m_userEnvironmentChanges));
......@@ -110,12 +110,12 @@ QVariantMap BuildConfiguration::toMap() const
void BuildConfiguration::cloneSteps(BuildConfiguration *source)
{
Q_ASSERT(source);
for (int i = 0; i < LastStepType; ++i) {
foreach (BuildStep *originalbs, source->steps(StepType(i))) {
IBuildStepFactory *factory(findCloneFactory(this, StepType(i), originalbs));
for (int i = 0; i < BuildStep::LastStepType; ++i) {
foreach (BuildStep *originalbs, source->steps(BuildStep::Type(i))) {
IBuildStepFactory *factory(findCloneFactory(this, BuildStep::Type(i), originalbs));
if (!factory)
continue;
BuildStep *clonebs(factory->clone(this, StepType(i), originalbs));
BuildStep *clonebs(factory->clone(this, BuildStep::Type(i), originalbs));
if (clonebs)
m_steps[i].append(clonebs);
}
......@@ -136,17 +136,17 @@ bool BuildConfiguration::fromMap(const QVariantMap &map)
qWarning() << "No buildstep data found (continuing).";
continue;
}
IBuildStepFactory *factory(findRestoreFactory(this, Build, bsData));
IBuildStepFactory *factory(findRestoreFactory(this, BuildStep::Build, bsData));
if (!factory) {
qWarning() << "No factory for buildstep found (continuing).";
continue;
}
BuildStep *bs(factory->restore(this, Build, bsData));
BuildStep *bs(factory->restore(this, BuildStep::Build, bsData));
if (!bs) {
qWarning() << "Restoration of buildstep failed (continuing).";
continue;
}
insertStep(Build, m_steps[Build].count(), bs);
insertStep(BuildStep::Build, m_steps[BuildStep::Build].count(), bs);
}
maxI = map.value(QLatin1String(CLEAN_STEPS_COUNT_KEY), 0).toInt();
......@@ -158,17 +158,17 @@ bool BuildConfiguration::fromMap(const QVariantMap &map)
qWarning() << "No cleanstep data found for (continuing).";
continue;
}
IBuildStepFactory *factory(findRestoreFactory(this, Clean, bsData));
IBuildStepFactory *factory(findRestoreFactory(this, BuildStep::Clean, bsData));
if (!factory) {
qWarning() << "No factory for cleanstep found (continuing).";
continue;
}
BuildStep *bs(factory->restore(this, Clean, bsData));
BuildStep *bs(factory->restore(this, BuildStep::Clean, bsData));
if (!bs) {
qWarning() << "Restoration of cleanstep failed (continuing).";
continue;
}
insertStep(Clean, m_steps[Clean].count(), bs);
insertStep(BuildStep::Clean, m_steps[BuildStep::Clean].count(), bs);
}
m_clearSystemEnvironment = map.value(QLatin1String(CLEAR_SYSTEM_ENVIRONMENT_KEY)).toBool();
......@@ -177,21 +177,21 @@ bool BuildConfiguration::fromMap(const QVariantMap &map)
return true;
}
QList<BuildStep *> BuildConfiguration::steps(StepType type) const
QList<BuildStep *> BuildConfiguration::steps(BuildStep::Type type) const
{
Q_ASSERT(type >= 0 && type < LastStepType);
Q_ASSERT(type >= 0 && type < BuildStep::LastStepType);
return m_steps[type];
}
void BuildConfiguration::insertStep(StepType type, int position, BuildStep *step)
void BuildConfiguration::insertStep(BuildStep::Type type, int position, BuildStep *step)
{
Q_ASSERT(type >= 0 && type < LastStepType);
Q_ASSERT(type >= 0 && type < BuildStep::LastStepType);
m_steps[type].insert(position, step);
}
bool BuildConfiguration::removeStep(StepType type, int position)
bool BuildConfiguration::removeStep(BuildStep::Type type, int position)
{
Q_ASSERT(type >= 0 && type < LastStepType);
Q_ASSERT(type >= 0 && type < BuildStep::LastStepType);
ProjectExplorer::BuildManager *bm =
ProjectExplorer::ProjectExplorerPlugin::instance()->buildManager();
......@@ -203,9 +203,9 @@ bool BuildConfiguration::removeStep(StepType type, int position)
return true;
}
void BuildConfiguration::moveStepUp(StepType type, int position)
void BuildConfiguration::moveStepUp(BuildStep::Type type, int position)
{
Q_ASSERT(type >= 0 && type < LastStepType);
Q_ASSERT(type >= 0 && type < BuildStep::LastStepType);
if (position <= 0 || m_steps[type].size() <= 1)
return;
m_steps[type].swap(position - 1, position);
......
......@@ -53,10 +53,10 @@ public:
// ctors are protected
virtual ~BuildConfiguration();
QList<BuildStep *> steps(StepType type) const;
void insertStep(StepType type, int position, BuildStep *step);
bool removeStep(StepType type, int position);
void moveStepUp(StepType type, int position);
QList<BuildStep *> steps(BuildStep::Type type) const;
void insertStep(BuildStep::Type type, int position, BuildStep *step);
bool removeStep(BuildStep::Type type, int position);
void moveStepUp(BuildStep::Type type, int position);
virtual QString buildDirectory() const = 0;
......@@ -85,7 +85,7 @@ protected:
virtual bool fromMap(const QVariantMap &map);
private:
QList<BuildStep *> m_steps[LastStepType];
QList<BuildStep *> m_steps[BuildStep::LastStepType];
Target *m_target;
bool m_clearSystemEnvironment;
......
......@@ -414,7 +414,7 @@ void BuildManager::buildProjects(const QList<BuildConfiguration *> &configuratio
{
QList<BuildStep *> steps;
foreach(BuildConfiguration *bc, configurations)
steps.append(bc->steps(Build));
steps.append(bc->steps(BuildStep::Build));
bool success = buildQueueAppend(steps);
if (!success) {
......@@ -431,7 +431,7 @@ void BuildManager::cleanProjects(const QList<BuildConfiguration *> &configuratio
{
QList<BuildStep *> steps;
foreach(BuildConfiguration *bc, configurations)
steps.append(bc->steps(Clean));
steps.append(bc->steps(BuildStep::Clean));
bool success = buildQueueAppend(steps);
if (!success) {
......
......@@ -249,8 +249,8 @@ void BuildSettingsWidget::updateBuildSettings()
BuildConfigWidget *generalConfigWidget = m_target->project()->createConfigWidget();
addSubWidget(generalConfigWidget->displayName(), generalConfigWidget);
addSubWidget(tr("Build Steps"), new BuildStepsPage(m_target, Build));
addSubWidget(tr("Clean Steps"), new BuildStepsPage(m_target, Clean));
addSubWidget(tr("Build Steps"), new BuildStepsPage(m_target, BuildStep::Build));
addSubWidget(tr("Clean Steps"), new BuildStepsPage(m_target, BuildStep::Clean));
QList<BuildConfigWidget *> subConfigWidgets = m_target->project()->subConfigWidgets();
foreach (BuildConfigWidget *subConfigWidget, subConfigWidgets)
......
......@@ -39,10 +39,6 @@
namespace ProjectExplorer {
enum StepType { Build = 0,
Clean = 1,
LastStepType = 2};
class BuildConfiguration;
/*
......@@ -76,6 +72,13 @@ protected:
BuildStep(BuildConfiguration *bc, BuildStep *bs);
public:
enum Type {
Build = 0,
Clean,
LastStepType
};
Q_ENUMS(Type)
virtual ~BuildStep();
// This function is run in the gui thread,
......@@ -122,17 +125,17 @@ public:
virtual ~IBuildStepFactory();
// used to show the list of possible additons to a target, returns a list of types
virtual QStringList availableCreationIds(BuildConfiguration *parent, StepType type) const = 0;
virtual QStringList availableCreationIds(BuildConfiguration *parent, BuildStep::Type type) const = 0;
// used to translate the types to names to display to the user
virtual QString displayNameForId(const QString &id) const = 0;
virtual bool canCreate(BuildConfiguration *parent, StepType type, const QString &id) const = 0;
virtual BuildStep *create(BuildConfiguration *parent, StepType type, const QString &id) = 0;
virtual bool canCreate(BuildConfiguration *parent, BuildStep::Type type, const QString &id) const = 0;
virtual BuildStep *create(BuildConfiguration *parent, BuildStep::Type type, const QString &id) = 0;
// used to recreate the runConfigurations when restoring settings
virtual bool canRestore(BuildConfiguration *parent, StepType type, const QVariantMap &map) const = 0;
virtual BuildStep *restore(BuildConfiguration *parent, StepType type, const QVariantMap &map) = 0;
virtual bool canClone(BuildConfiguration *parent, StepType type, BuildStep *product) const = 0;
virtual BuildStep *clone(BuildConfiguration *parent, StepType type, BuildStep *product) = 0;
virtual bool canRestore(BuildConfiguration *parent, BuildStep::Type type, const QVariantMap &map) const = 0;
virtual BuildStep *restore(BuildConfiguration *parent, BuildStep::Type type, const QVariantMap &map) = 0;
virtual bool canClone(BuildConfiguration *parent, BuildStep::Type type, BuildStep *product) const = 0;
virtual BuildStep *clone(BuildConfiguration *parent, BuildStep::Type type, BuildStep *product) = 0;
};
class PROJECTEXPLORER_EXPORT BuildConfigWidget
......
......@@ -50,7 +50,7 @@
using namespace ProjectExplorer;
using namespace ProjectExplorer::Internal;
BuildStepsPage::BuildStepsPage(Target *target, StepType type) :
BuildStepsPage::BuildStepsPage(Target *target, BuildStep::Type type) :
BuildConfigWidget(),
m_type(type),
m_addButton(0)
......@@ -83,7 +83,7 @@ void BuildStepsPage::updateSummary()
QString BuildStepsPage::displayName() const
{
if (m_type == Build)
if (m_type == BuildStep::Build)
return tr("Build Steps");
else
return tr("Clean Steps");
......@@ -295,7 +295,7 @@ void BuildStepsPage::setupUi()
QHBoxLayout *hboxLayout = new QHBoxLayout();
hboxLayout->setContentsMargins(0, 4, 0, 0);
m_addButton = new QPushButton(this);
m_addButton->setText(m_type == Clean ? tr("Add Clean Step") : tr("Add Build Step"));
m_addButton->setText(m_type == BuildStep::Clean ? tr("Add Clean Step") : tr("Add Build Step"));
m_addButton->setMenu(new QMenu(this));
hboxLayout->addWidget(m_addButton);
......
......@@ -67,7 +67,7 @@ class BuildStepsPage : public BuildConfigWidget
Q_OBJECT
public:
explicit BuildStepsPage(Target *target, StepType type);
explicit BuildStepsPage(Target *target, BuildStep::Type type);
virtual ~BuildStepsPage();
QString displayName() const;
......@@ -88,7 +88,7 @@ private:
BuildConfiguration * m_configuration;
QHash<QAction *, QPair<QString, ProjectExplorer::IBuildStepFactory *> > m_addBuildStepHash;
StepType m_type;
BuildStep::Type m_type;
QList<BuildStepsWidgetStruct> m_buildSteps;
......
......@@ -185,39 +185,39 @@ ProcessStepFactory::~ProcessStepFactory()
{
}
bool ProcessStepFactory::canCreate(BuildConfiguration *parent, StepType type, const QString &id) const
bool ProcessStepFactory::canCreate(BuildConfiguration *parent, BuildStep::Type type, const QString &id) const
{
Q_UNUSED(parent);
Q_UNUSED(type);
return id == QLatin1String(PROCESS_STEP_ID);
}
BuildStep *ProcessStepFactory::create(BuildConfiguration *parent, StepType type, const QString &id)
BuildStep *ProcessStepFactory::create(BuildConfiguration *parent, BuildStep::Type type, const QString &id)
{
if (!canCreate(parent, type, id))
return 0;
return new ProcessStep(parent);
}
bool ProcessStepFactory::canClone(BuildConfiguration *parent, StepType type, BuildStep *bs) const
bool ProcessStepFactory::canClone(BuildConfiguration *parent, BuildStep::Type type, BuildStep *bs) const
{
return canCreate(parent, type, bs->id());
}
BuildStep *ProcessStepFactory::clone(BuildConfiguration *parent, StepType type, BuildStep *bs)
BuildStep *ProcessStepFactory::clone(BuildConfiguration *parent, BuildStep::Type type, BuildStep *bs)
{
if (!canClone(parent, type, bs))
return 0;
return new ProcessStep(parent, static_cast<ProcessStep *>(bs));
}
bool ProcessStepFactory::canRestore(BuildConfiguration *parent, StepType type, const QVariantMap &map) const
bool ProcessStepFactory::canRestore(BuildConfiguration *parent, BuildStep::Type type, const QVariantMap &map) const
{
QString id(ProjectExplorer::idFromMap(map));
return canCreate(parent, type, id);
}
BuildStep *ProcessStepFactory::restore(BuildConfiguration *parent, StepType type, const QVariantMap &map)
BuildStep *ProcessStepFactory::restore(BuildConfiguration *parent, BuildStep::Type type, const QVariantMap &map)