Valgrind: Use SshConnectionManager to handle connections

Change-Id: I15a985880cdd48b74524089492dc9a32f7448999
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
hjk
2016-02-02 15:43:00 +01:00
parent 75e13a3aeb
commit bbadda2f25
2 changed files with 10 additions and 2 deletions

View File

@@ -26,6 +26,8 @@
#include "valgrindprocess.h"
#include <ssh/sshconnectionmanager.h>
#include <utils/fileutils.h>
#include <utils/qtcassert.h>
#include <utils/qtcprocess.h>
@@ -46,6 +48,12 @@ ValgrindProcess::ValgrindProcess(const IDevice::ConstPtr &device,
m_pid = 0;
}
ValgrindProcess::~ValgrindProcess()
{
if (m_remote.m_connection)
QSsh::releaseConnection(m_remote.m_connection);
}
void ValgrindProcess::setProcessChannelMode(QProcess::ProcessChannelMode mode)
{
if (isLocal())
@@ -125,9 +133,8 @@ void ValgrindProcess::run()
} else {
// connect to host and wait for connection
// FIXME: Use aquireConnection() instead.
if (!m_remote.m_connection)
m_remote.m_connection = new QSsh::SshConnection(m_device->sshParameters(), this);
m_remote.m_connection = QSsh::acquireConnection(m_device->sshParameters());
if (m_remote.m_connection->state() != QSsh::SshConnection::Connected) {
connect(m_remote.m_connection, &QSsh::SshConnection::connected,

View File

@@ -47,6 +47,7 @@ class ValgrindProcess : public QObject
public:
ValgrindProcess(const ProjectExplorer::IDevice::ConstPtr &device, QObject *parent);
~ValgrindProcess();
bool isRunning() const;