Autotools: Use string aspect directly in configure step

Task-number: QTCREATORBUG-29168
Change-Id: I5c9a69fff51f01d5498eba6bbdf676be22fe5e82
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2023-07-06 10:15:53 +02:00
parent 20700feb84
commit 5330e4bc31

View File

@@ -37,48 +37,42 @@ namespace AutotoolsProjectManager::Internal {
class ConfigureStep final : public AbstractProcessStep
{
public:
ConfigureStep(BuildStepList *bsl, Id id);
ConfigureStep(BuildStepList *bsl, Id id)
: AbstractProcessStep(bsl, id)
{
arguments.setDisplayStyle(StringAspect::LineEditDisplay);
arguments.setSettingsKey("AutotoolsProjectManager.ConfigureStep.AdditionalArguments");
arguments.setLabelText(Tr::tr("Arguments:"));
arguments.setHistoryCompleter("AutotoolsPM.History.ConfigureArgs");
void setAdditionalArguments(const QString &list);
connect(&arguments, &BaseAspect::changed, this, [this] {
m_runConfigure = true;
});
setCommandLineProvider([this] {
return getCommandLine(arguments());
});
setSummaryUpdater([this] {
ProcessParameters param;
setupProcessParameters(&param);
return param.summaryInWorkdir(displayName());
});
}
private:
void doRun() final;
CommandLine getCommandLine(const QString &arguments);
CommandLine getCommandLine(const QString &arguments)
{
return {project()->projectDirectory() / "configure", arguments, CommandLine::Raw};
}
bool m_runConfigure = false;
StringAspect arguments{this};
};
ConfigureStep::ConfigureStep(BuildStepList *bsl, Id id)
: AbstractProcessStep(bsl, id)
{
auto arguments = addAspect<StringAspect>();
arguments->setDisplayStyle(StringAspect::LineEditDisplay);
arguments->setSettingsKey("AutotoolsProjectManager.ConfigureStep.AdditionalArguments");
arguments->setLabelText(Tr::tr("Arguments:"));
arguments->setHistoryCompleter("AutotoolsPM.History.ConfigureArgs");
connect(arguments, &BaseAspect::changed, this, [this] {
m_runConfigure = true;
});
setCommandLineProvider([this, arguments] {
return getCommandLine(arguments->value());
});
setSummaryUpdater([this] {
ProcessParameters param;
setupProcessParameters(&param);
return param.summaryInWorkdir(displayName());
});
}
CommandLine ConfigureStep::getCommandLine(const QString &arguments)
{
return {project()->projectDirectory() / "configure", arguments, CommandLine::Raw};
}
void ConfigureStep::doRun()
{
// Check whether we need to run configure