diff options
author | hjk <hjk@qt.io> | 2023-07-06 10:15:53 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2023-07-07 12:25:36 +0000 |
commit | 5330e4bc317dd0fde28ef0f101ede1017df87b91 (patch) | |
tree | f6d0bc7e00f4b46eb01ed3277a3dd179d3c3a6aa /src/plugins/autotoolsprojectmanager | |
parent | 20700feb84d16b59456031d69c460f52c3db159a (diff) |
Autotools: Use string aspect directly in configure step
Task-number: QTCREATORBUG-29168
Change-Id: I5c9a69fff51f01d5498eba6bbdf676be22fe5e82
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/autotoolsprojectmanager')
-rw-r--r-- | src/plugins/autotoolsprojectmanager/configurestep.cpp | 62 |
1 files changed, 28 insertions, 34 deletions
diff --git a/src/plugins/autotoolsprojectmanager/configurestep.cpp b/src/plugins/autotoolsprojectmanager/configurestep.cpp index 6975a1cd91a..2eaf905f5a6 100644 --- a/src/plugins/autotoolsprojectmanager/configurestep.cpp +++ b/src/plugins/autotoolsprojectmanager/configurestep.cpp @@ -37,48 +37,42 @@ namespace AutotoolsProjectManager::Internal { class ConfigureStep final : public AbstractProcessStep { public: - ConfigureStep(BuildStepList *bsl, Id id); - - void setAdditionalArguments(const QString &list); + 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"); + + connect(&arguments, &BaseAspect::changed, this, [this] { + m_runConfigure = true; + }); + + setCommandLineProvider([this] { + return getCommandLine(arguments()); + }); + + setSummaryUpdater([this] { + ProcessParameters param; + setupProcessParameters(¶m); + + 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(¶m); - - 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 |