From 5e3af5b0f514121d24511193f99a35bbf7e1336c Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 2 Mar 2023 14:03:41 +0100 Subject: [PATCH] Qnx: Avoid use of Environment iterators Change-Id: I2a1be67c1d21a731de1ada3d58099896fb676ffa Reviewed-by: Christian Kandeler --- src/plugins/qnx/qnxdevice.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/plugins/qnx/qnxdevice.cpp b/src/plugins/qnx/qnxdevice.cpp index 0c7c99a5c39..89d1241cfe7 100644 --- a/src/plugins/qnx/qnxdevice.cpp +++ b/src/plugins/qnx/qnxdevice.cpp @@ -61,10 +61,9 @@ QString QnxProcessImpl::fullCommandLine(const CommandLine &commandLine) const ProcessArgs::quoteArg(m_setup.m_workingDirectory.toString())); const Environment env = m_setup.m_environment; - for (auto it = env.constBegin(); it != env.constEnd(); ++it) { - fullCommandLine += QString::fromLatin1("%1='%2' ") - .arg(env.key(it)).arg(env.expandedValueForKey(env.key(it))); - } + env.forEachEntry([&](const QString &key, const QString &, bool) { + fullCommandLine += QString("%1='%2' ").arg(key).arg(env.expandedValueForKey(key)); + }); fullCommandLine += QString::fromLatin1("%1 & echo $! > %2").arg(cmd).arg(m_pidFile);