diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index 754a7f0281e..d38542fefde 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -613,8 +613,9 @@ QString LinuxProcessInterface::fullCommandLine(const CommandLine &commandLine) c cmd.addArgs(QString("echo ") + s_pidMarker + "$$" + s_pidMarker + " && ", CommandLine::Raw); const Environment &env = m_setup.m_environment; - for (auto it = env.constBegin(); it != env.constEnd(); ++it) - cmd.addArgs(env.key(it) + "='" + env.expandedValueForKey(env.key(it)) + '\'', CommandLine::Raw); + env.forEachEntry([&](const QString &key, const QString &, bool) { + cmd.addArgs(key + "='" + env.expandedValueForKey(key) + '\'', CommandLine::Raw); + }); if (m_setup.m_terminalMode == TerminalMode::Off) cmd.addArg("exec"); diff --git a/src/plugins/remotelinux/makeinstallstep.cpp b/src/plugins/remotelinux/makeinstallstep.cpp index ea7b6364586..a23dba21037 100644 --- a/src/plugins/remotelinux/makeinstallstep.cpp +++ b/src/plugins/remotelinux/makeinstallstep.cpp @@ -172,12 +172,10 @@ bool MakeInstallStep::init() const MakeInstallCommand cmd = buildSystem()->makeInstallCommand(rootDir); if (cmd.environment.hasChanges()) { Environment env = processParameters()->environment(); - for (auto it = cmd.environment.constBegin(); it != cmd.environment.constEnd(); ++it) { - if (cmd.environment.isEnabled(it)) { - const QString key = cmd.environment.key(it); + cmd.environment.forEachEntry([&](const QString &key, const QString &, bool enabled) { + if (enabled) env.set(key, cmd.environment.expandedValueForKey(key)); - } - } + }); processParameters()->setEnvironment(env); } m_noInstallTarget = false;