From a5318cba79d981c494b87265ceacf0bd0e8ef66f Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Thu, 4 Nov 2021 18:35:47 +0100 Subject: [PATCH] Use QtcProcess in SshConnection::connectionInfo() Change-Id: Ibc0966ee43266d5d0f5f4f71274f11a4150eab3b Reviewed-by: hjk Reviewed-by: Christian Kandeler --- src/libs/ssh/sshconnection.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libs/ssh/sshconnection.cpp b/src/libs/ssh/sshconnection.cpp index 5b1dc86d7d3..159fdec803d 100644 --- a/src/libs/ssh/sshconnection.cpp +++ b/src/libs/ssh/sshconnection.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -273,9 +274,10 @@ SshConnectionInfo SshConnection::connectionInfo() const QTC_ASSERT(state() == Connected, return SshConnectionInfo()); if (d->connInfo.isValid()) return d->connInfo; - QProcess p; - p.start(SshSettings::sshFilePath().toString(), d->connectionArgs(SshSettings::sshFilePath()) - << "echo" << "-n" << "$SSH_CLIENT"); + QtcProcess p; + const FilePath sshFilePath = SshSettings::sshFilePath(); + p.setCommand({sshFilePath, d->connectionArgs(sshFilePath) << "echo" << "-n" << "$SSH_CLIENT"}); + p.start(); if (!p.waitForStarted() || !p.waitForFinished()) { qCWarning(Internal::sshLog) << "failed to retrieve connection info:" << p.errorString(); return SshConnectionInfo();