Commit bbadda2f authored by hjk's avatar hjk

Valgrind: Use SshConnectionManager to handle connections

Change-Id: I15a985880cdd48b74524089492dc9a32f7448999
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@theqtcompany.com>
parent 75e13a3a
......@@ -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,
......
......@@ -47,6 +47,7 @@ class ValgrindProcess : public QObject
public:
ValgrindProcess(const ProjectExplorer::IDevice::ConstPtr &device, QObject *parent);
~ValgrindProcess();
bool isRunning() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment