Utils: Replace Environment.isValid() with .hasChanges()

That's closer to the intended semantics. The "other" use in docker
will be changed to an optional<Environment> as follow-up to
keep this here mechanical.

Change-Id: I43ef9da6c9c7731b28f9d6fab6413ce9c4f428b4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2023-01-27 12:30:03 +01:00
parent 930cbdf68b
commit dab859e776
12 changed files with 14 additions and 14 deletions

View File

@@ -668,7 +668,7 @@ public:
Environment fullEnvironment() const
{
Environment env = m_setup.m_environment;
if (!env.isValid()) {
if (!env.hasChanges()) {
// FIXME: Either switch to using EnvironmentChange instead of full Environments, or
// feed the full environment into the QtcProcess instead of fixing it up here.
// qWarning("QtcProcess::start: Empty environment set when running '%s'.",
@@ -1190,7 +1190,7 @@ QString QtcProcess::toStandaloneCommandLine() const
d->m_setup.m_workingDirectory.path();
}
parts.append("-i");
if (d->m_setup.m_environment.isValid()) {
if (d->m_setup.m_environment.hasChanges()) {
const QStringList envVars = d->m_setup.m_environment.toStringList();
std::transform(envVars.cbegin(), envVars.cend(),
std::back_inserter(parts), ProcessArgs::quoteArgUnix);