forked from qt-creator/qt-creator
ProjectExplorer: Pass macro expander to ArgumentsAspect::arguments
To remove the last user of IRCAspect::runConfiguration. Change-Id: I1390166730112008a4050877f96bb29f274e7ef1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
@@ -125,7 +125,7 @@ void BareMetalDebugSupport::start()
|
||||
Runnable inferior;
|
||||
inferior.executable = bin;
|
||||
if (auto aspect = rc->extraAspect<ArgumentsAspect>())
|
||||
inferior.commandLineArguments = aspect->arguments();
|
||||
inferior.commandLineArguments = aspect->arguments(rc->macroExpander());
|
||||
setInferior(inferior);
|
||||
setSymbolFile(bin);
|
||||
setStartMode(AttachToRemoteServer);
|
||||
|
||||
@@ -100,7 +100,7 @@ IosRunner::IosRunner(RunControl *runControl)
|
||||
stopRunningRunControl(runControl);
|
||||
auto runConfig = qobject_cast<IosRunConfiguration *>(runControl->runConfiguration());
|
||||
m_bundleDir = runConfig->bundleDirectory().toString();
|
||||
m_arguments = runConfig->extraAspect<ArgumentsAspect>()->arguments();
|
||||
m_arguments = runConfig->extraAspect<ArgumentsAspect>()->arguments(runConfig->macroExpander());
|
||||
m_device = DeviceKitInformation::device(runConfig->target()->kit());
|
||||
m_deviceType = runConfig->deviceType();
|
||||
}
|
||||
@@ -386,7 +386,8 @@ IosQmlProfilerSupport::IosQmlProfilerSupport(RunControl *runControl)
|
||||
auto iosRunConfig = qobject_cast<IosRunConfiguration *>(runControl->runConfiguration());
|
||||
Runnable runnable;
|
||||
runnable.executable = iosRunConfig->localExecutable().toUserOutput();
|
||||
runnable.commandLineArguments = iosRunConfig->extraAspect<ArgumentsAspect>()->arguments();
|
||||
runnable.commandLineArguments =
|
||||
iosRunConfig->extraAspect<ArgumentsAspect>()->arguments(iosRunConfig->macroExpander());
|
||||
runControl->setDisplayName(iosRunConfig->applicationName());
|
||||
runControl->setRunnable(runnable);
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ Runnable CustomExecutableRunConfiguration::runnable() const
|
||||
|
||||
Runnable r;
|
||||
r.executable = extraAspect<ExecutableAspect>()->executable().toString();
|
||||
r.commandLineArguments = extraAspect<ArgumentsAspect>()->arguments();
|
||||
r.commandLineArguments = extraAspect<ArgumentsAspect>()->arguments(macroExpander());
|
||||
r.environment = extraAspect<EnvironmentAspect>()->environment();
|
||||
r.workingDirectory = workingDirectory.toString();
|
||||
r.device = DeviceManager::instance()->defaultDevice(Constants::DESKTOP_DEVICE_TYPE);
|
||||
|
||||
@@ -440,7 +440,7 @@ Runnable RunConfiguration::runnable() const
|
||||
if (auto aspect = extraAspect<ExecutableAspect>())
|
||||
r.executable = aspect->executable().toString();
|
||||
if (auto aspect = extraAspect<ArgumentsAspect>())
|
||||
r.commandLineArguments = aspect->arguments();
|
||||
r.commandLineArguments = aspect->arguments(macroExpander());
|
||||
if (auto aspect = extraAspect<WorkingDirectoryAspect>())
|
||||
r.workingDirectory = aspect->workingDirectory(macroExpander()).toString();
|
||||
if (auto aspect = extraAspect<EnvironmentAspect>())
|
||||
|
||||
@@ -245,9 +245,10 @@ ArgumentsAspect::ArgumentsAspect(RunConfiguration *runConfig)
|
||||
setSettingsKey("RunConfiguration.Arguments");
|
||||
}
|
||||
|
||||
QString ArgumentsAspect::arguments() const
|
||||
QString ArgumentsAspect::arguments(const MacroExpander *expander) const
|
||||
{
|
||||
return runConfiguration()->macroExpander()->expandProcessArgs(m_arguments);
|
||||
QTC_ASSERT(expander, return m_arguments);
|
||||
return expander->expandProcessArgs(m_arguments);
|
||||
}
|
||||
|
||||
QString ArgumentsAspect::unexpandedArguments() const
|
||||
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
|
||||
void addToConfigurationLayout(QFormLayout *layout) override;
|
||||
|
||||
QString arguments() const;
|
||||
QString arguments(const Utils::MacroExpander *expander) const;
|
||||
QString unexpandedArguments() const;
|
||||
|
||||
void setArguments(const QString &arguments);
|
||||
|
||||
@@ -238,7 +238,7 @@ private:
|
||||
|
||||
bool supportsDebugger() const { return true; }
|
||||
QString mainScript() const { return extraAspect<MainScriptAspect>()->value(); }
|
||||
QString arguments() const { return extraAspect<ArgumentsAspect>()->arguments(); }
|
||||
QString arguments() const { return extraAspect<ArgumentsAspect>()->arguments(macroExpander()); }
|
||||
QString interpreter() const { return extraAspect<InterpreterAspect>()->value(); }
|
||||
|
||||
void updateTargetInformation();
|
||||
@@ -286,7 +286,8 @@ Runnable PythonRunConfiguration::runnable() const
|
||||
{
|
||||
Runnable r;
|
||||
QtcProcess::addArg(&r.commandLineArguments, mainScript());
|
||||
QtcProcess::addArgs(&r.commandLineArguments, extraAspect<ArgumentsAspect>()->arguments());
|
||||
QtcProcess::addArgs(&r.commandLineArguments,
|
||||
extraAspect<ArgumentsAspect>()->arguments(macroExpander()));
|
||||
r.executable = extraAspect<InterpreterAspect>()->value();
|
||||
r.environment = extraAspect<EnvironmentAspect>()->environment();
|
||||
return r;
|
||||
|
||||
@@ -354,7 +354,7 @@ QString QmlProjectRunConfiguration::executable() const
|
||||
QString QmlProjectRunConfiguration::commandLineArguments() const
|
||||
{
|
||||
// arguments in .user file
|
||||
QString args = extraAspect<ArgumentsAspect>()->arguments();
|
||||
QString args = extraAspect<ArgumentsAspect>()->arguments(macroExpander());
|
||||
const Target *currentTarget = target();
|
||||
const IDevice::ConstPtr device = DeviceKitInformation::device(currentTarget->kit());
|
||||
const Utils::OsType osType = device ? device->osType() : Utils::HostOsInfo::hostOs();
|
||||
|
||||
@@ -82,7 +82,7 @@ WinRtRunnerHelper::WinRtRunnerHelper(ProjectExplorer::RunWorker *runWorker, QStr
|
||||
m_executableFilePath += QStringLiteral(".exe");
|
||||
|
||||
if (auto aspect = runConfiguration->extraAspect<ArgumentsAspect>())
|
||||
m_arguments = aspect->arguments();
|
||||
m_arguments = aspect->arguments(runConfiguration->macroExpander());
|
||||
if (auto aspect = runConfiguration->extraAspect<UninstallAfterStopAspect>())
|
||||
m_uninstallAfterStop = aspect->value();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user