Utils: Replace Environment::size() check by some isValid() function

More descriptive, and later implementable without full expansion.

Change-Id: Ic3b17ea0b07273f292827a7b63e7695b4bd1cf23
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2022-06-01 15:19:31 +02:00
parent b72f41c7f0
commit d76458a8b6
14 changed files with 24 additions and 19 deletions

View File

@@ -611,7 +611,7 @@ public:
Environment fullEnvironment() const
{
Environment env = m_setup.m_environment;
if (env.size() == 0) {
if (!env.isValid()) {
// 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'.",
@@ -1113,7 +1113,7 @@ QString QtcProcess::toStandaloneCommandLine() const
d->m_setup.m_workingDirectory.path();
}
parts.append("-i");
if (d->m_setup.m_environment.size() > 0) {
if (d->m_setup.m_environment.isValid()) {
const QStringList envVars = d->m_setup.m_environment.toStringList();
std::transform(envVars.cbegin(), envVars.cend(),
std::back_inserter(parts), ProcessArgs::quoteArgUnix);