Make step is always called "Make"

So provide it through the base class, also for the factories.

Change-Id: Ie4a6113b785ec6c0ddde694ec0bcd11a26331c39
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Eike Ziller
2018-05-17 15:42:38 +02:00
parent 58bd043e27
commit 981a98f34f
4 changed files with 11 additions and 10 deletions

View File

@@ -38,14 +38,10 @@ namespace GenericProjectManager {
namespace Internal {
const char GENERIC_MS_ID[] = "GenericProjectManager.GenericMakeStep";
const char GENERIC_MS_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("GenericProjectManager::Internal::GenericMakeStep",
"Make");
GenericMakeStep::GenericMakeStep(BuildStepList *parent, const QString &buildTarget)
: MakeStep(parent, GENERIC_MS_ID, buildTarget, {"all", "clean"})
{
setDefaultDisplayName(QCoreApplication::translate("GenericProjectManager::Internal::GenericMakeStep",
GENERIC_MS_DISPLAY_NAME));
}
bool GenericMakeStep::init(QList<const BuildStep *> &earlierSteps)
@@ -99,8 +95,7 @@ GenericMakeAllStepFactory::GenericMakeAllStepFactory()
};
registerStep<Step>(GENERIC_MS_ID);
setDisplayName(QCoreApplication::translate(
"GenericProjectManager::Internal::GenericMakeStep", GENERIC_MS_DISPLAY_NAME));
setDisplayName(MakeStep::defaultDisplayName());
setSupportedProjectType(Constants::GENERICPROJECT_ID);
setSupportedStepLists({ProjectExplorer::Constants::BUILDSTEPS_BUILD,
ProjectExplorer::Constants::BUILDSTEPS_DEPLOY});
@@ -122,8 +117,7 @@ GenericMakeCleanStepFactory::GenericMakeCleanStepFactory()
};
registerStep<Step>(GENERIC_MS_ID);
setDisplayName(QCoreApplication::translate(
"GenericProjectManager::Internal::GenericMakeStep", GENERIC_MS_DISPLAY_NAME));
setDisplayName(MakeStep::defaultDisplayName());
setSupportedProjectType(Constants::GENERICPROJECT_ID);
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_CLEAN);
}

View File

@@ -54,6 +54,7 @@ MakeStep::MakeStep(BuildStepList *parent,
: AbstractProcessStep(parent, id),
m_availableTargets(availableTargets)
{
setDefaultDisplayName(defaultDisplayName());
if (!buildTarget.isEmpty())
setBuildTarget(buildTarget, true);
}
@@ -68,6 +69,11 @@ bool MakeStep::isClean() const
return m_clean;
}
QString MakeStep::defaultDisplayName()
{
return tr("Make");
}
void MakeStep::setMakeCommand(const QString &command)
{
m_makeCommand = command;

View File

@@ -61,6 +61,8 @@ public:
void setClean(bool clean);
bool isClean() const;
static QString defaultDisplayName();
private:
QVariantMap toMap() const override;
bool fromMap(const QVariantMap &map) override;

View File

@@ -54,7 +54,6 @@ const char MAKESTEP_BS_ID[] = "Qt4ProjectManager.MakeStep";
QmakeMakeStep::QmakeMakeStep(BuildStepList *bsl)
: MakeStep(bsl, MAKESTEP_BS_ID)
{
setDefaultDisplayName(tr("Make", "Qt MakeStep display name."));
if (bsl->id() == ProjectExplorer::Constants::BUILDSTEPS_CLEAN) {
setClean(true);
setUserArguments("clean");
@@ -208,5 +207,5 @@ QmakeMakeStepFactory::QmakeMakeStepFactory()
{
registerStep<QmakeMakeStep>(MAKESTEP_BS_ID);
setSupportedProjectType(Constants::QMAKEPROJECT_ID);
setDisplayName(tr("Make"));
setDisplayName(MakeStep::defaultDisplayName());
}