forked from qt-creator/qt-creator
Incredibuild: Fix handling of build commands
The default command is supposed to be a placeholder not
an entry done by the user.
Allow entering an empty string again to rely on the default.
As on it fix place holders inside strings.
Amends e04b9a5348
.
Change-Id: I111c843d9620ecc8cf5a7a3c63ca7ac92e588e0c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This commit is contained in:
@@ -280,7 +280,7 @@ BuildConsoleBuildStep::BuildConsoleBuildStep(BuildStepList *buildStepList, Id id
|
||||
setCommandLineProvider([=] {
|
||||
QStringList args;
|
||||
|
||||
QString cmd("/Command= %0");
|
||||
QString cmd("/Command= %1");
|
||||
cmd = cmd.arg(commandBuilder->fullCommandFlag(keepJobNum->value()));
|
||||
args.append(cmd);
|
||||
|
||||
|
@@ -48,9 +48,6 @@ void CommandBuilder::toMap(QVariantMap *map) const
|
||||
|
||||
void CommandBuilder::setCommand(const QString &command)
|
||||
{
|
||||
if (command == defaultCommand())
|
||||
m_command.clear();
|
||||
else
|
||||
m_command = command;
|
||||
}
|
||||
|
||||
|
@@ -54,8 +54,9 @@ public:
|
||||
virtual QString defaultArguments() const { return QString(); }
|
||||
virtual QString setMultiProcessArg(QString args) { return args; }
|
||||
|
||||
QString command() { return m_command.isEmpty() ? defaultCommand() : m_command; }
|
||||
QString command() const { return m_command; }
|
||||
void setCommand(const QString &command);
|
||||
QString effectiveCommand() const { return m_command.isEmpty() ? defaultCommand() : m_command; }
|
||||
|
||||
QString arguments() { return m_args.isEmpty() ? defaultArguments() : m_args; }
|
||||
void setArguments(const QString &arguments);
|
||||
|
@@ -99,8 +99,8 @@ QString CommandBuilderAspect::fullCommandFlag(bool keepJobNum) const
|
||||
if (!keepJobNum)
|
||||
argsLine = d->m_activeCommandBuilder->setMultiProcessArg(argsLine);
|
||||
|
||||
QString fullCommand("\"%0\" %1");
|
||||
fullCommand = fullCommand.arg(d->m_activeCommandBuilder->command(), argsLine);
|
||||
QString fullCommand("\"%1\" %2");
|
||||
fullCommand = fullCommand.arg(d->m_activeCommandBuilder->effectiveCommand(), argsLine);
|
||||
|
||||
return fullCommand;
|
||||
}
|
||||
@@ -212,8 +212,8 @@ void CommandBuilderAspect::updateGui()
|
||||
d->commandBuilder->setCurrentText(d->m_activeCommandBuilder->displayName());
|
||||
|
||||
const QString defaultCommand = d->m_activeCommandBuilder->defaultCommand();
|
||||
d->makePathChooser->lineEdit()->setPlaceholderText(defaultCommand);
|
||||
d->makePathChooser->setPath(d->m_activeCommandBuilder->command());
|
||||
d->makePathChooser->setDefaultValue(defaultCommand);
|
||||
|
||||
const QString defaultArgs = d->m_activeCommandBuilder->defaultArguments();
|
||||
d->makeArgumentsLineEdit->setPlaceholderText(defaultArgs);
|
||||
|
@@ -106,7 +106,7 @@ IBConsoleBuildStep::IBConsoleBuildStep(BuildStepList *buildStepList, Id id)
|
||||
QStringList args;
|
||||
|
||||
if (nice->value() != 0)
|
||||
args.append(QString("--nice %0 ").arg(nice->value()));
|
||||
args.append(QString("--nice %1 ").arg(nice->value()));
|
||||
|
||||
if (alternate->value())
|
||||
args.append("--alternate");
|
||||
|
@@ -58,7 +58,7 @@ QString MakeCommandBuilder::defaultCommand() const
|
||||
if (target) {
|
||||
ToolChain *toolChain = ToolChainKitAspect::toolChain(target->kit(), ProjectExplorer::Constants::CXX_LANGUAGE_ID);
|
||||
if (toolChain)
|
||||
return toolChain->makeCommand(buildConfig->environment()).toString();
|
||||
return toolChain->makeCommand(buildConfig->environment()).toUserOutput();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user