aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2019-05-15 13:59:43 +0200
committerhjk <hjk@qt.io>2019-05-15 12:55:22 +0000
commit9433b8a7e78cfbe13a3dfe4ad489c4329a701b47 (patch)
tree3d2c2b60960a212cb8387165b7c92746e3caab29 /src/plugins
parentd1f9e466daf369969bc0dae8c14914ed79c3acb5 (diff)
ProjectExplorer: Use Utils::FileName in ProcessParameters
For the command and the working directory. Change-Id: Ia69dc7100aeb57bb6e1b35f4dd4f3cf3763d8cda Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/android/androidbuildapkstep.cpp7
-rw-r--r--src/plugins/android/androidpackageinstallationstep.cpp4
-rw-r--r--src/plugins/autotoolsprojectmanager/autogenstep.cpp10
-rw-r--r--src/plugins/autotoolsprojectmanager/autoreconfstep.cpp10
-rw-r--r--src/plugins/autotoolsprojectmanager/configurestep.cpp8
-rw-r--r--src/plugins/cmakeprojectmanager/cmakebuildstep.cpp8
-rw-r--r--src/plugins/cmakeprojectmanager/cmakebuildstep.h2
-rw-r--r--src/plugins/cmakeprojectmanager/cmakeproject.cpp2
-rw-r--r--src/plugins/ios/iosbuildstep.cpp8
-rw-r--r--src/plugins/ios/iosdsymbuildstep.cpp8
-rw-r--r--src/plugins/nim/project/nimcompilerbuildstep.cpp4
-rw-r--r--src/plugins/nim/project/nimcompilerbuildstepconfigwidget.cpp2
-rw-r--r--src/plugins/projectexplorer/abstractprocessstep.cpp10
-rw-r--r--src/plugins/projectexplorer/ioutputparser.cpp5
-rw-r--r--src/plugins/projectexplorer/ioutputparser.h1
-rw-r--r--src/plugins/projectexplorer/makestep.cpp37
-rw-r--r--src/plugins/projectexplorer/makestep.h12
-rw-r--r--src/plugins/projectexplorer/processparameters.cpp30
-rw-r--r--src/plugins/projectexplorer/processparameters.h21
-rw-r--r--src/plugins/projectexplorer/processstep.cpp4
-rw-r--r--src/plugins/projectexplorer/project.cpp2
-rw-r--r--src/plugins/qmakeprojectmanager/qmakemakestep.cpp7
-rw-r--r--src/plugins/qmakeprojectmanager/qmakestep.cpp8
-rw-r--r--src/plugins/remotelinux/makeinstallstep.cpp5
-rw-r--r--src/plugins/winrt/winrtpackagedeploymentstep.cpp2
25 files changed, 116 insertions, 101 deletions
diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp
index e09d90bf120..1af41da340e 100644
--- a/src/plugins/android/androidbuildapkstep.cpp
+++ b/src/plugins/android/androidbuildapkstep.cpp
@@ -70,6 +70,7 @@
#include <memory>
using namespace ProjectExplorer;
+using namespace Utils;
using namespace Android::Internal;
namespace {
@@ -90,10 +91,10 @@ static void setupProcessParameters(ProcessParameters *pp,
const QString &command)
{
pp->setMacroExpander(bc->macroExpander());
- pp->setWorkingDirectory(bc->buildDirectory().toString());
+ pp->setWorkingDirectory(bc->buildDirectory());
Utils::Environment env = bc->environment();
pp->setEnvironment(env);
- pp->setCommand(command);
+ pp->setCommand(FileName::fromString(command));
pp->setArguments(Utils::QtcProcess::joinArgs(arguments));
pp->resolveAll();
}
@@ -279,7 +280,7 @@ bool AndroidBuildApkStep::init()
// Generate arguments with keystore password concealed
ProjectExplorer::ProcessParameters pp2;
setupProcessParameters(&pp2, bc, argumentsPasswordConcealed, command);
- m_command = pp2.effectiveCommand();
+ m_command = pp2.effectiveCommand().toString();
m_argumentsPasswordConcealed = pp2.prettyArguments();
return true;
diff --git a/src/plugins/android/androidpackageinstallationstep.cpp b/src/plugins/android/androidpackageinstallationstep.cpp
index f49cb2ea077..325c750fd40 100644
--- a/src/plugins/android/androidpackageinstallationstep.cpp
+++ b/src/plugins/android/androidpackageinstallationstep.cpp
@@ -72,8 +72,8 @@ bool AndroidPackageInstallationStep::init()
ProcessParameters *pp = processParameters();
pp->setMacroExpander(bc->macroExpander());
- pp->setWorkingDirectory(bc->buildDirectory().toString());
- pp->setCommand(tc->makeCommand(bc->environment()).toString());
+ pp->setWorkingDirectory(bc->buildDirectory());
+ pp->setCommand(tc->makeCommand(bc->environment()));
Environment env = bc->environment();
Environment::setupEnglishOutput(&env);
pp->setEnvironment(env);
diff --git a/src/plugins/autotoolsprojectmanager/autogenstep.cpp b/src/plugins/autotoolsprojectmanager/autogenstep.cpp
index 77f9193b413..950982ee152 100644
--- a/src/plugins/autotoolsprojectmanager/autogenstep.cpp
+++ b/src/plugins/autotoolsprojectmanager/autogenstep.cpp
@@ -77,9 +77,8 @@ bool AutogenStep::init()
ProcessParameters *pp = processParameters();
pp->setMacroExpander(bc->macroExpander());
pp->setEnvironment(bc->environment());
- const QString projectDir(bc->target()->project()->projectDirectory().toString());
- pp->setWorkingDirectory(projectDir);
- pp->setCommand("./autogen.sh");
+ pp->setWorkingDirectory(bc->target()->project()->projectDirectory());
+ pp->setCommand(Utils::FileName::fromString("./autogen.sh"));
pp->setArguments(m_additionalArgumentsAspect->value());
pp->resolveAll();
@@ -122,9 +121,8 @@ BuildStepConfigWidget *AutogenStep::createConfigWidget()
ProcessParameters param;
param.setMacroExpander(bc->macroExpander());
param.setEnvironment(bc->environment());
- const QString projectDir(bc->target()->project()->projectDirectory().toString());
- param.setWorkingDirectory(projectDir);
- param.setCommand("./autogen.sh");
+ param.setWorkingDirectory(bc->target()->project()->projectDirectory());
+ param.setCommand(Utils::FileName::fromString("./autogen.sh"));
param.setArguments(m_additionalArgumentsAspect->value());
widget->setSummaryText(param.summary(displayName()));
diff --git a/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp b/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp
index ab9ae1147f4..dd44dd40151 100644
--- a/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp
+++ b/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp
@@ -75,9 +75,8 @@ bool AutoreconfStep::init()
ProcessParameters *pp = processParameters();
pp->setMacroExpander(bc->macroExpander());
pp->setEnvironment(bc->environment());
- const QString projectDir(bc->target()->project()->projectDirectory().toString());
- pp->setWorkingDirectory(projectDir);
- pp->setCommand("autoreconf");
+ pp->setWorkingDirectory(bc->target()->project()->projectDirectory());
+ pp->setCommand(Utils::FileName::fromString("autoreconf"));
pp->setArguments(m_additionalArgumentsAspect->value());
pp->resolveAll();
@@ -114,9 +113,8 @@ BuildStepConfigWidget *AutoreconfStep::createConfigWidget()
ProcessParameters param;
param.setMacroExpander(bc->macroExpander());
param.setEnvironment(bc->environment());
- const QString projectDir(bc->target()->project()->projectDirectory().toString());
- param.setWorkingDirectory(projectDir);
- param.setCommand("autoreconf");
+ param.setWorkingDirectory(bc->target()->project()->projectDirectory());
+ param.setCommand(Utils::FileName::fromString("autoreconf"));
param.setArguments(m_additionalArgumentsAspect->value());
widget->setSummaryText(param.summary(displayName()));
diff --git a/src/plugins/autotoolsprojectmanager/configurestep.cpp b/src/plugins/autotoolsprojectmanager/configurestep.cpp
index 66fcbc03e3b..8cda28566da 100644
--- a/src/plugins/autotoolsprojectmanager/configurestep.cpp
+++ b/src/plugins/autotoolsprojectmanager/configurestep.cpp
@@ -97,8 +97,8 @@ bool ConfigureStep::init()
ProcessParameters *pp = processParameters();
pp->setMacroExpander(bc->macroExpander());
pp->setEnvironment(bc->environment());
- pp->setWorkingDirectory(bc->buildDirectory().toString());
- pp->setCommand(projectDirRelativeToBuildDir(bc) + "configure");
+ pp->setWorkingDirectory(bc->buildDirectory());
+ pp->setCommand(Utils::FileName::fromString(projectDirRelativeToBuildDir(bc) + "configure"));
pp->setArguments(m_additionalArgumentsAspect->value());
pp->resolveAll();
@@ -158,8 +158,8 @@ void ConfigureStep::updateDetails()
ProcessParameters param;
param.setMacroExpander(bc->macroExpander());
param.setEnvironment(bc->environment());
- param.setWorkingDirectory(bc->buildDirectory().toString());
- param.setCommand(projectDirRelativeToBuildDir(bc) + "configure");
+ param.setWorkingDirectory(bc->buildDirectory());
+ param.setCommand(Utils::FileName::fromString(projectDirRelativeToBuildDir(bc) + "configure"));
param.setArguments(m_additionalArgumentsAspect->value());
m_widget->setSummaryText(param.summaryInWorkdir(displayName()));
diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp
index 7d2ef903c90..e1470375342 100644
--- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp
@@ -218,7 +218,7 @@ bool CMakeBuildStep::init()
if (!env.value("NINJA_STATUS").startsWith(m_ninjaProgressString))
env.set("NINJA_STATUS", m_ninjaProgressString + "%o/sec] ");
pp->setEnvironment(env);
- pp->setWorkingDirectory(bc->buildDirectory().toString());
+ pp->setWorkingDirectory(bc->buildDirectory());
pp->setCommand(cmakeCommand());
pp->setArguments(arguments);
pp->resolveAll();
@@ -373,10 +373,10 @@ QString CMakeBuildStep::allArguments(const CMakeRunConfiguration *rc) const
return arguments;
}
-QString CMakeBuildStep::cmakeCommand() const
+Utils::FileName CMakeBuildStep::cmakeCommand() const
{
CMakeTool *tool = CMakeKitAspect::cmakeTool(target()->kit());
- return tool ? tool->cmakeExecutable().toString() : QString();
+ return tool ? tool->cmakeExecutable() : Utils::FileName();
}
QString CMakeBuildStep::cleanTarget()
@@ -531,7 +531,7 @@ void CMakeBuildStepConfigWidget::updateDetails()
ProcessParameters param;
param.setMacroExpander(bc->macroExpander());
param.setEnvironment(bc->environment());
- param.setWorkingDirectory(bc->buildDirectory().toString());
+ param.setWorkingDirectory(bc->buildDirectory());
param.setCommand(m_buildStep->cmakeCommand());
param.setArguments(m_buildStep->allArguments(nullptr));
diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.h b/src/plugins/cmakeprojectmanager/cmakebuildstep.h
index 9e76889d28f..73c29ff5ab0 100644
--- a/src/plugins/cmakeprojectmanager/cmakebuildstep.h
+++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.h
@@ -66,7 +66,7 @@ public:
QString allArguments(const CMakeRunConfiguration *rc) const;
- QString cmakeCommand() const;
+ Utils::FileName cmakeCommand() const;
QVariantMap toMap() const override;
diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp
index 67a2a6020e1..3e92f60b678 100644
--- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp
@@ -635,7 +635,7 @@ MakeInstallCommand CMakeProject::makeInstallCommand(const Target *target,
if (const BuildConfiguration * const bc = target->activeBuildConfiguration()) {
if (const auto cmakeStep = bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD)
->firstOfType<CMakeBuildStep>()) {
- cmd.command = FileName::fromString(cmakeStep->cmakeCommand());
+ cmd.command = cmakeStep->cmakeCommand();
}
}
cmd.arguments << "--build" << "." << "--target" << "install";
diff --git a/src/plugins/ios/iosbuildstep.cpp b/src/plugins/ios/iosbuildstep.cpp
index 5b99ac65299..18616684ad5 100644
--- a/src/plugins/ios/iosbuildstep.cpp
+++ b/src/plugins/ios/iosbuildstep.cpp
@@ -87,11 +87,11 @@ bool IosBuildStep::init()
ProcessParameters *pp = processParameters();
pp->setMacroExpander(bc->macroExpander());
- pp->setWorkingDirectory(bc->buildDirectory().toString());
+ pp->setWorkingDirectory(bc->buildDirectory());
Utils::Environment env = bc->environment();
Utils::Environment::setupEnglishOutput(&env);
pp->setEnvironment(env);
- pp->setCommand(buildCommand());
+ pp->setCommand(Utils::FileName::fromString(buildCommand()));
pp->setArguments(Utils::QtcProcess::joinArgs(allArguments()));
pp->resolveAll();
@@ -251,9 +251,9 @@ void IosBuildStepConfigWidget::updateDetails()
ProcessParameters param;
param.setMacroExpander(bc->macroExpander());
- param.setWorkingDirectory(bc->buildDirectory().toString());
+ param.setWorkingDirectory(bc->buildDirectory());
param.setEnvironment(bc->environment());
- param.setCommand(m_buildStep->buildCommand());
+ param.setCommand(Utils::FileName::fromString(m_buildStep->buildCommand()));
param.setArguments(Utils::QtcProcess::joinArgs(m_buildStep->allArguments()));
setSummaryText(param.summary(displayName()));
diff --git a/src/plugins/ios/iosdsymbuildstep.cpp b/src/plugins/ios/iosdsymbuildstep.cpp
index c8b550352c1..f9cac493529 100644
--- a/src/plugins/ios/iosdsymbuildstep.cpp
+++ b/src/plugins/ios/iosdsymbuildstep.cpp
@@ -68,11 +68,11 @@ bool IosDsymBuildStep::init()
ProcessParameters *pp = processParameters();
pp->setMacroExpander(bc->macroExpander());
- pp->setWorkingDirectory(bc->buildDirectory().toString());
+ pp->setWorkingDirectory(bc->buildDirectory());
Utils::Environment env = bc->environment();
Utils::Environment::setupEnglishOutput(&env);
pp->setEnvironment(env);
- pp->setCommand(command());
+ pp->setCommand(Utils::FileName::fromString(command()));
pp->setArguments(Utils::QtcProcess::joinArgs(arguments()));
pp->resolveAll();
@@ -268,9 +268,9 @@ void IosDsymBuildStepConfigWidget::updateDetails()
ProcessParameters param;
param.setMacroExpander(bc->macroExpander());
- param.setWorkingDirectory(bc->buildDirectory().toString());
+ param.setWorkingDirectory(bc->buildDirectory());
param.setEnvironment(bc->environment());
- param.setCommand(m_buildStep->command());
+ param.setCommand(Utils::FileName::fromString(m_buildStep->command()));
param.setArguments(Utils::QtcProcess::joinArgs(m_buildStep->arguments()));
setSummaryText(param.summary(displayName()));
diff --git a/src/plugins/nim/project/nimcompilerbuildstep.cpp b/src/plugins/nim/project/nimcompilerbuildstep.cpp
index e03ddc85cfd..596fb750e94 100644
--- a/src/plugins/nim/project/nimcompilerbuildstep.cpp
+++ b/src/plugins/nim/project/nimcompilerbuildstep.cpp
@@ -228,14 +228,14 @@ void NimCompilerBuildStep::updateCommand()
Kit *kit = target()->kit();
auto tc = dynamic_cast<NimToolChain*>(ToolChainKitAspect::toolChain(kit, Constants::C_NIMLANGUAGE_ID));
QTC_ASSERT(tc, return);
- processParameters()->setCommand(tc->compilerCommand().toString());
+ processParameters()->setCommand(tc->compilerCommand());
}
void NimCompilerBuildStep::updateWorkingDirectory()
{
auto bc = qobject_cast<NimBuildConfiguration *>(buildConfiguration());
QTC_ASSERT(bc, return);
- processParameters()->setWorkingDirectory(bc->buildDirectory().toString());
+ processParameters()->setWorkingDirectory(bc->buildDirectory());
}
void NimCompilerBuildStep::updateArguments()
diff --git a/src/plugins/nim/project/nimcompilerbuildstepconfigwidget.cpp b/src/plugins/nim/project/nimcompilerbuildstepconfigwidget.cpp
index 600f6cf9159..d9e7b5beb7e 100644
--- a/src/plugins/nim/project/nimcompilerbuildstepconfigwidget.cpp
+++ b/src/plugins/nim/project/nimcompilerbuildstepconfigwidget.cpp
@@ -104,7 +104,7 @@ void NimCompilerBuildStepConfigWidget::updateCommandLineText()
ProcessParameters *parameters = m_buildStep->processParameters();
QStringList command;
- command << parameters->command();
+ command << parameters->command().toString();
command << parameters->arguments();
// Remove empty args
diff --git a/src/plugins/projectexplorer/abstractprocessstep.cpp b/src/plugins/projectexplorer/abstractprocessstep.cpp
index fd3a22e6f89..6073a168e61 100644
--- a/src/plugins/projectexplorer/abstractprocessstep.cpp
+++ b/src/plugins/projectexplorer/abstractprocessstep.cpp
@@ -200,7 +200,7 @@ bool AbstractProcessStep::init()
void AbstractProcessStep::doRun()
{
- QDir wd(d->m_param.effectiveWorkingDirectory());
+ QDir wd(d->m_param.effectiveWorkingDirectory().toString());
if (!wd.exists()) {
if (!wd.mkpath(wd.absolutePath())) {
emit addOutput(tr("Could not create directory \"%1\"")
@@ -211,7 +211,7 @@ void AbstractProcessStep::doRun()
}
}
- QString effectiveCommand = d->m_param.effectiveCommand();
+ QString effectiveCommand = d->m_param.effectiveCommand().toString();
if (!QFileInfo::exists(effectiveCommand)) {
processStartupFailed();
finish(false);
@@ -275,7 +275,7 @@ void AbstractProcessStep::cleanUp(QProcess *process)
void AbstractProcessStep::processStarted()
{
emit addOutput(tr("Starting: \"%1\" %2")
- .arg(QDir::toNativeSeparators(d->m_param.effectiveCommand()),
+ .arg(QDir::toNativeSeparators(d->m_param.effectiveCommand().toString()),
d->m_param.prettyArguments()),
BuildStep::OutputFormat::NormalMessage);
}
@@ -291,7 +291,7 @@ void AbstractProcessStep::processFinished(int exitCode, QProcess::ExitStatus sta
if (d->m_outputParserChain)
d->m_outputParserChain->flush();
- QString command = QDir::toNativeSeparators(d->m_param.effectiveCommand());
+ QString command = QDir::toNativeSeparators(d->m_param.effectiveCommand().toString());
if (status == QProcess::NormalExit && exitCode == 0) {
emit addOutput(tr("The process \"%1\" exited normally.").arg(command),
BuildStep::OutputFormat::NormalMessage);
@@ -313,7 +313,7 @@ void AbstractProcessStep::processFinished(int exitCode, QProcess::ExitStatus sta
void AbstractProcessStep::processStartupFailed()
{
emit addOutput(tr("Could not start process \"%1\" %2")
- .arg(QDir::toNativeSeparators(d->m_param.effectiveCommand()),
+ .arg(QDir::toNativeSeparators(d->m_param.effectiveCommand().toString()),
d->m_param.prettyArguments()),
BuildStep::OutputFormat::ErrorMessage);
}
diff --git a/src/plugins/projectexplorer/ioutputparser.cpp b/src/plugins/projectexplorer/ioutputparser.cpp
index 0da70059484..112bac4a229 100644
--- a/src/plugins/projectexplorer/ioutputparser.cpp
+++ b/src/plugins/projectexplorer/ioutputparser.cpp
@@ -207,6 +207,11 @@ void IOutputParser::setWorkingDirectory(const QString &workingDirectory)
m_parser->setWorkingDirectory(workingDirectory);
}
+void IOutputParser::setWorkingDirectory(const Utils::FileName &fn)
+{
+ setWorkingDirectory(fn.toString());
+}
+
void IOutputParser::flush()
{
doFlush();
diff --git a/src/plugins/projectexplorer/ioutputparser.h b/src/plugins/projectexplorer/ioutputparser.h
index 47c8f4f1c0a..91fbc4c30db 100644
--- a/src/plugins/projectexplorer/ioutputparser.h
+++ b/src/plugins/projectexplorer/ioutputparser.h
@@ -53,6 +53,7 @@ public:
virtual bool hasFatalErrors() const;
virtual void setWorkingDirectory(const QString &workingDirectory);
+ void setWorkingDirectory(const Utils::FileName &fn);
void flush(); // flush out pending tasks
diff --git a/src/plugins/projectexplorer/makestep.cpp b/src/plugins/projectexplorer/makestep.cpp
index 96e1bee83e8..e6b19c93bd2 100644
--- a/src/plugins/projectexplorer/makestep.cpp
+++ b/src/plugins/projectexplorer/makestep.cpp
@@ -79,7 +79,7 @@ bool MakeStep::init()
if (!bc)
emit addTask(Task::buildConfigurationMissingTask());
- const QString make = effectiveMakeCommand();
+ const FileName make = effectiveMakeCommand();
if (make.isEmpty())
emit addTask(makeCommandMissingTask());
@@ -90,7 +90,7 @@ bool MakeStep::init()
ProcessParameters *pp = processParameters();
pp->setMacroExpander(bc->macroExpander());
- pp->setWorkingDirectory(bc->buildDirectory().toString());
+ pp->setWorkingDirectory(bc->buildDirectory());
pp->setEnvironment(environment(bc));
pp->setCommand(make);
pp->setArguments(allArguments());
@@ -105,7 +105,7 @@ bool MakeStep::init()
IOutputParser *parser = target()->kit()->createOutputParser();
if (parser)
appendOutputParser(parser);
- outputParser()->setWorkingDirectory(pp->effectiveWorkingDirectory());
+ outputParser()->setWorkingDirectory(pp->effectiveWorkingDirectory().toString());
return AbstractProcessStep::init();
}
@@ -143,18 +143,18 @@ static const QList<ToolChain *> preferredToolChains(const Kit *kit)
return tcs;
}
-QString MakeStep::defaultMakeCommand() const
+FileName MakeStep::defaultMakeCommand() const
{
BuildConfiguration *bc = buildConfiguration();
if (!bc)
- return QString();
+ return {};
const Utils::Environment env = environment(bc);
for (const ToolChain *tc : preferredToolChains(target()->kit())) {
FileName make = tc->makeCommand(env);
if (!make.isEmpty())
- return make.toString();
+ return make;
}
- return QString();
+ return {};
}
QString MakeStep::msgNoMakeCommand()
@@ -260,7 +260,7 @@ Utils::Environment MakeStep::environment(BuildConfiguration *bc) const
return env;
}
-void MakeStep::setMakeCommand(const QString &command)
+void MakeStep::setMakeCommand(const FileName &command)
{
m_makeCommand = command;
}
@@ -271,7 +271,7 @@ QVariantMap MakeStep::toMap() const
map.insert(id().withSuffix(BUILD_TARGETS_SUFFIX).toString(), m_buildTargets);
map.insert(id().withSuffix(MAKE_ARGUMENTS_SUFFIX).toString(), m_makeArguments);
- map.insert(id().withSuffix(MAKE_COMMAND_SUFFIX).toString(), m_makeCommand);
+ map.insert(id().withSuffix(MAKE_COMMAND_SUFFIX).toString(), m_makeCommand.toString());
map.insert(id().withSuffix(CLEAN_SUFFIX).toString(), m_clean);
const QString jobCountKey = id().withSuffix(JOBCOUNT_SUFFIX).toString();
if (m_userJobCount != defaultJobCount())
@@ -286,7 +286,8 @@ bool MakeStep::fromMap(const QVariantMap &map)
{
m_buildTargets = map.value(id().withSuffix(BUILD_TARGETS_SUFFIX).toString()).toStringList();
m_makeArguments = map.value(id().withSuffix(MAKE_ARGUMENTS_SUFFIX).toString()).toString();
- m_makeCommand = map.value(id().withSuffix(MAKE_COMMAND_SUFFIX).toString()).toString();
+ m_makeCommand = FileName::fromString(
+ map.value(id().withSuffix(MAKE_COMMAND_SUFFIX).toString()).toString());
m_clean = map.value(id().withSuffix(CLEAN_SUFFIX).toString()).toBool();
m_overrideMakeflags = map.value(id().withSuffix(OVERRIDE_MAKEFLAGS_SUFFIX).toString(), false).toBool();
m_userJobCount = map.value(id().withSuffix(JOBCOUNT_SUFFIX).toString(), defaultJobCount()).toInt();
@@ -324,12 +325,12 @@ void MakeStep::setUserArguments(const QString &args)
m_makeArguments = args;
}
-QString MakeStep::makeCommand() const
+FileName MakeStep::makeCommand() const
{
return m_makeCommand;
}
-QString MakeStep::effectiveMakeCommand() const
+FileName MakeStep::effectiveMakeCommand() const
{
if (!m_makeCommand.isEmpty())
return m_makeCommand;
@@ -386,7 +387,7 @@ MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
m_ui->makeLineEdit->setExpectedKind(Utils::PathChooser::ExistingCommand);
m_ui->makeLineEdit->setBaseDirectory(Utils::PathChooser::homePath());
m_ui->makeLineEdit->setHistoryCompleter("PE.MakeCommand.History");
- m_ui->makeLineEdit->setPath(m_makeStep->makeCommand());
+ m_ui->makeLineEdit->setPath(m_makeStep->makeCommand().toString());
m_ui->makeArgumentsLineEdit->setText(m_makeStep->userArguments());
m_ui->nonOverrideWarning->setToolTip("<html><body><p>" +
tr("<code>MAKEFLAGS</code> specifies parallel jobs. Check \"%1\" to override.")
@@ -459,7 +460,7 @@ void MakeStepConfigWidget::updateDetails()
{
BuildConfiguration *bc = m_makeStep->buildConfiguration();
- const QString defaultMake = m_makeStep->defaultMakeCommand();
+ const QString defaultMake = m_makeStep->defaultMakeCommand().toString();
if (defaultMake.isEmpty())
m_ui->makeLabel->setText(tr("Make:"));
else
@@ -484,14 +485,14 @@ void MakeStepConfigWidget::updateDetails()
ProcessParameters param;
param.setMacroExpander(bc->macroExpander());
- param.setWorkingDirectory(bc->buildDirectory().toString());
+ param.setWorkingDirectory(bc->buildDirectory());
param.setCommand(m_makeStep->effectiveMakeCommand());
-
param.setArguments(m_makeStep->allArguments());
param.setEnvironment(m_makeStep->environment(bc));
if (param.commandMissing())
- setSummaryText(tr("<b>Make:</b> %1 not found in the environment.").arg(param.command())); // Override display text
+ setSummaryText(tr("<b>Make:</b> %1 not found in the environment.")
+ .arg(param.command().toString())); // Override display text
else
setSummaryText(param.summaryInWorkdir(displayName()));
}
@@ -504,7 +505,7 @@ void MakeStepConfigWidget::itemChanged(QListWidgetItem *item)
void MakeStepConfigWidget::makeLineEditTextEdited()
{
- m_makeStep->setMakeCommand(m_ui->makeLineEdit->rawPath());
+ m_makeStep->setMakeCommand(FileName::fromString(m_ui->makeLineEdit->rawPath()));
updateDetails();
}
diff --git a/src/plugins/projectexplorer/makestep.h b/src/plugins/projectexplorer/makestep.h
index 84718858b1f..5cee91237a9 100644
--- a/src/plugins/projectexplorer/makestep.h
+++ b/src/plugins/projectexplorer/makestep.h
@@ -28,6 +28,8 @@
#include "abstractprocessstep.h"
#include "projectexplorer_global.h"
+#include <utils/fileutils.h>
+
QT_FORWARD_DECLARE_CLASS(QListWidgetItem);
namespace Utils { class Environment; }
@@ -56,16 +58,16 @@ public:
QString allArguments() const;
QString userArguments() const;
void setUserArguments(const QString &args);
- QString makeCommand() const;
- void setMakeCommand(const QString &command);
- QString effectiveMakeCommand() const;
+ Utils::FileName makeCommand() const;
+ void setMakeCommand(const Utils::FileName &command);
+ Utils::FileName effectiveMakeCommand() const;
void setClean(bool clean);
bool isClean() const;
static QString defaultDisplayName();
- QString defaultMakeCommand() const;
+ Utils::FileName defaultMakeCommand() const;
static QString msgNoMakeCommand();
static Task makeCommandMissingTask();
@@ -91,7 +93,7 @@ private:
QStringList m_buildTargets;
QStringList m_availableTargets;
QString m_makeArguments;
- QString m_makeCommand;
+ Utils::FileName m_makeCommand;
int m_userJobCount = 4;
bool m_overrideMakeflags = false;
bool m_clean = false;
diff --git a/src/plugins/projectexplorer/processparameters.cpp b/src/plugins/projectexplorer/processparameters.cpp
index db56c57cdb1..6381c028c7b 100644
--- a/src/plugins/projectexplorer/processparameters.cpp
+++ b/src/plugins/projectexplorer/processparameters.cpp
@@ -44,7 +44,9 @@
\sa ProjectExplorer::AbstractProcessStep
*/
-using namespace ProjectExplorer;
+using namespace Utils;
+
+namespace ProjectExplorer {
ProcessParameters::ProcessParameters() :
m_macroExpander(nullptr),
@@ -56,7 +58,7 @@ ProcessParameters::ProcessParameters() :
Sets the executable to run.
*/
-void ProcessParameters::setCommand(const QString &cmd)
+void ProcessParameters::setCommand(const Utils::FileName &cmd)
{
m_command = cmd;
m_effectiveCommand.clear();
@@ -78,7 +80,7 @@ void ProcessParameters::setArguments(const QString &arguments)
Should be called from init().
*/
-void ProcessParameters::setWorkingDirectory(const QString &workingDirectory)
+void ProcessParameters::setWorkingDirectory(const FileName &workingDirectory)
{
m_workingDirectory = workingDirectory;
m_effectiveWorkingDirectory.clear();
@@ -103,13 +105,14 @@ void ProcessParameters::setWorkingDirectory(const QString &workingDirectory)
Gets the fully expanded working directory.
*/
-QString ProcessParameters::effectiveWorkingDirectory() const
+FileName ProcessParameters::effectiveWorkingDirectory() const
{
if (m_effectiveWorkingDirectory.isEmpty()) {
- QString wds = m_workingDirectory;
+ QString wds = m_workingDirectory.toString();
if (m_macroExpander)
wds = m_macroExpander->expand(wds);
- m_effectiveWorkingDirectory = QDir::cleanPath(m_environment.expandVariables(wds));
+ m_effectiveWorkingDirectory
+ = FileName::fromString(QDir::cleanPath(m_environment.expandVariables(wds)));
}
return m_effectiveWorkingDirectory;
}
@@ -118,14 +121,15 @@ QString ProcessParameters::effectiveWorkingDirectory() const
Gets the fully expanded command name to run.
*/
-QString ProcessParameters::effectiveCommand() const
+FileName ProcessParameters::effectiveCommand() const
{
if (m_effectiveCommand.isEmpty()) {
- QString cmd = m_command;
+ FileName cmd = m_command;
if (m_macroExpander)
cmd = m_macroExpander->expand(cmd);
m_effectiveCommand =
- m_environment.searchInPath(cmd, {Utils::FileName::fromString(effectiveWorkingDirectory())}).toString();
+ m_environment.searchInPath(cmd.toString(),
+ {effectiveWorkingDirectory()});
m_commandMissing = m_effectiveCommand.isEmpty();
if (m_commandMissing)
m_effectiveCommand = cmd;
@@ -155,7 +159,7 @@ QString ProcessParameters::effectiveArguments() const
QString ProcessParameters::prettyCommand() const
{
- QString cmd = m_command;
+ QString cmd = m_command.toString();
if (m_macroExpander)
cmd = m_macroExpander->expand(cmd);
return Utils::FileName::fromString(cmd).fileName();
@@ -164,7 +168,7 @@ QString ProcessParameters::prettyCommand() const
QString ProcessParameters::prettyArguments() const
{
QString margs = effectiveArguments();
- QString workDir = effectiveWorkingDirectory();
+ QString workDir = effectiveWorkingDirectory().toString();
Utils::QtcProcess::SplitError err;
Utils::QtcProcess::Arguments args =
Utils::QtcProcess::prepareArgs(margs, &err, Utils::HostOsInfo::hostOs(), &m_environment, &workDir);
@@ -187,7 +191,7 @@ QString ProcessParameters::summaryInWorkdir(const QString &displayName) const
.arg(displayName,
Utils::QtcProcess::quoteArg(prettyCommand()),
prettyArguments(),
- QDir::toNativeSeparators(effectiveWorkingDirectory()));
+ QDir::toNativeSeparators(effectiveWorkingDirectory().toString()));
}
void ProcessParameters::resolveAll()
@@ -196,3 +200,5 @@ void ProcessParameters::resolveAll()
effectiveArguments();
effectiveWorkingDirectory();
}
+
+} // ProcessExplorer
diff --git a/src/plugins/projectexplorer/processparameters.h b/src/plugins/projectexplorer/processparameters.h
index fd43e03bf70..ca192451539 100644
--- a/src/plugins/projectexplorer/processparameters.h
+++ b/src/plugins/projectexplorer/processparameters.h
@@ -28,6 +28,7 @@
#include "projectexplorer_export.h"
#include <utils/environment.h>
+#include <utils/fileutils.h>
namespace Utils { class MacroExpander; }
@@ -39,14 +40,14 @@ class PROJECTEXPLORER_EXPORT ProcessParameters
public:
ProcessParameters();
- void setCommand(const QString &cmd);
- QString command() const { return m_command; }
+ void setCommand(const Utils::FileName &cmd);
+ Utils::FileName command() const { return m_command; }
void setArguments(const QString &arguments);
QString arguments() const { return m_arguments; }
- void setWorkingDirectory(const QString &workingDirectory);
- QString workingDirectory() const { return m_workingDirectory; }
+ void setWorkingDirectory(const Utils::FileName &workingDirectory);
+ Utils::FileName workingDirectory() const { return m_workingDirectory; }
void setEnvironment(const Utils::Environment &env) { m_environment = env; }
Utils::Environment environment() const { return m_environment; }
@@ -55,9 +56,9 @@ public:
Utils::MacroExpander *macroExpander() const { return m_macroExpander; }
/// Get the fully expanded working directory:
- QString effectiveWorkingDirectory() const;
+ Utils::FileName effectiveWorkingDirectory() const;
/// Get the fully expanded command name to run:
- QString effectiveCommand() const;
+ Utils::FileName effectiveCommand() const;
/// Get the fully expanded arguments to use:
QString effectiveArguments() const;
@@ -71,14 +72,14 @@ public:
void resolveAll();
private:
- QString m_workingDirectory;
- QString m_command;
+ Utils::FileName m_workingDirectory;
+ Utils::FileName m_command;
QString m_arguments;
Utils::Environment m_environment;
Utils::MacroExpander *m_macroExpander;
- mutable QString m_effectiveWorkingDirectory;
- mutable QString m_effectiveCommand;
+ mutable Utils::FileName m_effectiveWorkingDirectory;
+ mutable Utils::FileName m_effectiveCommand;
mutable QString m_effectiveArguments;
mutable bool m_commandMissing;
};
diff --git a/src/plugins/projectexplorer/processstep.cpp b/src/plugins/projectexplorer/processstep.cpp
index aa50847678f..51ca66dbac9 100644
--- a/src/plugins/projectexplorer/processstep.cpp
+++ b/src/plugins/projectexplorer/processstep.cpp
@@ -93,8 +93,8 @@ void ProcessStep::setupProcessParameters(ProcessParameters *pp)
pp->setMacroExpander(bc ? bc->macroExpander() : Utils::globalMacroExpander());
pp->setEnvironment(bc ? bc->environment() : Utils::Environment::systemEnvironment());
- pp->setWorkingDirectory(workingDirectory);
- pp->setCommand(command);
+ pp->setWorkingDirectory(Utils::FileName::fromString(workingDirectory));
+ pp->setCommand(Utils::FileName::fromString(command));
pp->setArguments(arguments);
pp->resolveAll();
}
diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp
index b2b96ccb65e..a23e14f51ee 100644
--- a/src/plugins/projectexplorer/project.cpp
+++ b/src/plugins/projectexplorer/project.cpp
@@ -855,7 +855,7 @@ MakeInstallCommand Project::makeInstallCommand(const Target *target, const QStri
if (const BuildConfiguration * const bc = target->activeBuildConfiguration()) {
if (const auto makeStep = bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD)
->firstOfType<MakeStep>()) {
- cmd.command = Utils::FileName::fromString(makeStep->effectiveMakeCommand());
+ cmd.command = makeStep->effectiveMakeCommand();
}
}
cmd.arguments << "install" << ("INSTALL_ROOT=" + QDir::toNativeSeparators(installRoot));
diff --git a/src/plugins/qmakeprojectmanager/qmakemakestep.cpp b/src/plugins/qmakeprojectmanager/qmakemakestep.cpp
index a84d6224c9b..176df4cad1c 100644
--- a/src/plugins/qmakeprojectmanager/qmakemakestep.cpp
+++ b/src/plugins/qmakeprojectmanager/qmakemakestep.cpp
@@ -75,7 +75,7 @@ bool QmakeMakeStep::init()
if (!bc)
emit addTask(Task::buildConfigurationMissingTask());
- const QString make = effectiveMakeCommand();
+ Utils::FileName make = effectiveMakeCommand();
if (make.isEmpty())
emit addTask(makeCommandMissingTask());
@@ -96,7 +96,7 @@ bool QmakeMakeStep::init()
workingDirectory = bc->subNodeBuild()->buildDir();
else
workingDirectory = bc->buildDirectory().toString();
- pp->setWorkingDirectory(workingDirectory);
+ pp->setWorkingDirectory(Utils::FileName::fromString(workingDirectory));
pp->setCommand(make);
@@ -148,7 +148,8 @@ bool QmakeMakeStep::init()
objectsDir += "/release";
}
}
- QString relObjectsDir = QDir(pp->workingDirectory()).relativeFilePath(objectsDir);
+ QString relObjectsDir = QDir(pp->workingDirectory().toString())
+ .relativeFilePath(objectsDir);
if (relObjectsDir == ".")
relObjectsDir.clear();
if (!relObjectsDir.isEmpty())
diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp
index b7230c9b044..c05f212d6cc 100644
--- a/src/plugins/qmakeprojectmanager/qmakestep.cpp
+++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp
@@ -223,7 +223,7 @@ bool QMakeStep::init()
ProcessParameters *pp = processParameters();
pp->setMacroExpander(qmakeBc->macroExpander());
- pp->setWorkingDirectory(workingDirectory);
+ pp->setWorkingDirectory(Utils::FileName::fromString(workingDirectory));
pp->setEnvironment(qmakeBc->environment());
setOutputParser(new QMakeParser);
@@ -314,7 +314,7 @@ void QMakeStep::finish(bool success)
void QMakeStep::startOneCommand(const QString &command, const QString &args)
{
ProcessParameters *pp = processParameters();
- pp->setCommand(command);
+ pp->setCommand(Utils::FileName::fromString(command));
pp->setArguments(args);
pp->resolveAll();
@@ -343,7 +343,7 @@ void QMakeStep::runNextCommand()
case State::RUN_MAKE_QMAKE_ALL:
{
auto *parser = new GnuMakeParser;
- parser->setWorkingDirectory(processParameters()->workingDirectory());
+ parser->setWorkingDirectory(processParameters()->workingDirectory().toString());
setOutputParser(parser);
m_nextState = State::POST_PROCESS;
startOneCommand(m_makeExecutable, m_makeArguments);
@@ -439,7 +439,7 @@ void QMakeStep::setSeparateDebugInfo(bool enable)
QString QMakeStep::makeCommand() const
{
auto *ms = qobject_cast<BuildStepList *>(parent())->firstOfType<MakeStep>();
- return ms ? ms->effectiveMakeCommand() : QString();
+ return ms ? ms->effectiveMakeCommand().toString() : QString();
}
QString QMakeStep::makeArguments(const QString &makefile) const
diff --git a/src/plugins/remotelinux/makeinstallstep.cpp b/src/plugins/remotelinux/makeinstallstep.cpp
index 2980ea5ad02..7375de150c0 100644
--- a/src/plugins/remotelinux/makeinstallstep.cpp
+++ b/src/plugins/remotelinux/makeinstallstep.cpp
@@ -173,7 +173,7 @@ bool MakeInstallStep::cleanInstallRoot() const
void MakeInstallStep::updateCommandFromAspect()
{
- setMakeCommand(aspect<ExecutableAspect>()->executable().toString());
+ setMakeCommand(aspect<ExecutableAspect>()->executable());
updateFullCommandLine();
}
@@ -188,7 +188,8 @@ void MakeInstallStep::updateArgsFromAspect()
void MakeInstallStep::updateFullCommandLine()
{
static_cast<BaseStringAspect *>(aspect(FullCommandLineAspectId))->setValue(
- QDir::toNativeSeparators(QtcProcess::quoteArg(effectiveMakeCommand()))
+ QDir::toNativeSeparators(
+ QtcProcess::quoteArg(effectiveMakeCommand().toString()))
+ ' ' + userArguments());
}
diff --git a/src/plugins/winrt/winrtpackagedeploymentstep.cpp b/src/plugins/winrt/winrtpackagedeploymentstep.cpp
index 093947c64dc..d9c6c260e4e 100644
--- a/src/plugins/winrt/winrtpackagedeploymentstep.cpp
+++ b/src/plugins/winrt/winrtpackagedeploymentstep.cpp
@@ -107,7 +107,7 @@ bool WinRtPackageDeploymentStep::init()
QDir::toNativeSeparators(qt->binPath().toString())));
return false;
}
- params->setCommand(windeployqtPath);
+ params->setCommand(Utils::FileName::fromString(windeployqtPath));
params->setArguments(args);
params->setEnvironment(buildConfiguration()->environment());