forked from qt-creator/qt-creator
Use QtcProcess in SshConnection::connectionInfo()
Change-Id: Ibc0966ee43266d5d0f5f4f71274f11a4150eab3b Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
|
||||
#include <QByteArrayList>
|
||||
#include <QDir>
|
||||
@@ -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();
|
||||
|
Reference in New Issue
Block a user