forked from qt-creator/qt-creator
Valgrind: Use SshConnectionManager to handle connections
Change-Id: I15a985880cdd48b74524089492dc9a32f7448999 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
@@ -26,6 +26,8 @@
|
|||||||
|
|
||||||
#include "valgrindprocess.h"
|
#include "valgrindprocess.h"
|
||||||
|
|
||||||
|
#include <ssh/sshconnectionmanager.h>
|
||||||
|
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
@@ -46,6 +48,12 @@ ValgrindProcess::ValgrindProcess(const IDevice::ConstPtr &device,
|
|||||||
m_pid = 0;
|
m_pid = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ValgrindProcess::~ValgrindProcess()
|
||||||
|
{
|
||||||
|
if (m_remote.m_connection)
|
||||||
|
QSsh::releaseConnection(m_remote.m_connection);
|
||||||
|
}
|
||||||
|
|
||||||
void ValgrindProcess::setProcessChannelMode(QProcess::ProcessChannelMode mode)
|
void ValgrindProcess::setProcessChannelMode(QProcess::ProcessChannelMode mode)
|
||||||
{
|
{
|
||||||
if (isLocal())
|
if (isLocal())
|
||||||
@@ -125,9 +133,8 @@ void ValgrindProcess::run()
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// connect to host and wait for connection
|
// connect to host and wait for connection
|
||||||
// FIXME: Use aquireConnection() instead.
|
|
||||||
if (!m_remote.m_connection)
|
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) {
|
if (m_remote.m_connection->state() != QSsh::SshConnection::Connected) {
|
||||||
connect(m_remote.m_connection, &QSsh::SshConnection::connected,
|
connect(m_remote.m_connection, &QSsh::SshConnection::connected,
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ class ValgrindProcess : public QObject
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
ValgrindProcess(const ProjectExplorer::IDevice::ConstPtr &device, QObject *parent);
|
ValgrindProcess(const ProjectExplorer::IDevice::ConstPtr &device, QObject *parent);
|
||||||
|
~ValgrindProcess();
|
||||||
|
|
||||||
bool isRunning() const;
|
bool isRunning() const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user