Commit 2faf3b25 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

SSH: SshRemoteProcessRunner does not need to be a shared pointer.



Change-Id: I49cf2e113d23ebebe0939adbf90a1a88c84998a5
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@nokia.com>
parent c8fc9b33
......@@ -234,24 +234,16 @@ void SshRemoteProcessRunnerPrivate::assertState(State allowedState,
} // namespace Internal
SshRemoteProcessRunner::Ptr SshRemoteProcessRunner::create(const SshConnectionParameters &params)
{
return SshRemoteProcessRunner::Ptr(new SshRemoteProcessRunner(params));
}
SshRemoteProcessRunner::Ptr SshRemoteProcessRunner::create(const SshConnection::Ptr &connection)
{
return SshRemoteProcessRunner::Ptr(new SshRemoteProcessRunner(connection));
}
SshRemoteProcessRunner::SshRemoteProcessRunner(const SshConnectionParameters &params)
: d(new Internal::SshRemoteProcessRunnerPrivate(params, this))
SshRemoteProcessRunner::SshRemoteProcessRunner(const SshConnectionParameters &params,
QObject *parent)
: QObject(parent), d(new Internal::SshRemoteProcessRunnerPrivate(params, this))
{
init();
}
SshRemoteProcessRunner::SshRemoteProcessRunner(const SshConnection::Ptr &connection)
: d(new Internal::SshRemoteProcessRunnerPrivate(connection, this))
SshRemoteProcessRunner::SshRemoteProcessRunner(const SshConnection::Ptr &connection,
QObject *parent)
: QObject(parent), d(new Internal::SshRemoteProcessRunnerPrivate(connection, this))
{
init();
}
......
......@@ -46,10 +46,8 @@ class QTCREATOR_UTILS_EXPORT SshRemoteProcessRunner : public QObject
Q_OBJECT
public:
typedef QSharedPointer<SshRemoteProcessRunner> Ptr;
static Ptr create(const SshConnectionParameters &params);
static Ptr create(const SshConnection::Ptr &connection);
SshRemoteProcessRunner(const SshConnectionParameters &params, QObject *parent = 0);
SshRemoteProcessRunner(const SshConnection::Ptr &connection, QObject *parent = 0);
void run(const QByteArray &command);
void runInTerminal(const QByteArray &command,
......@@ -67,8 +65,6 @@ signals:
void processClosed(int exitStatus); // values are of type SshRemoteProcess::ExitStatus
private:
SshRemoteProcessRunner(const SshConnectionParameters &params);
SshRemoteProcessRunner(const SshConnection::Ptr &connection);
void init();
Internal::SshRemoteProcessRunnerPrivate *d;
......
......@@ -64,18 +64,23 @@
namespace Debugger {
namespace Internal {
SshIODevice::SshIODevice(Utils::SshRemoteProcessRunner::Ptr r)
SshIODevice::SshIODevice(Utils::SshRemoteProcessRunner *r)
: runner(r)
, buckethead(0)
{
setOpenMode(QIODevice::ReadWrite | QIODevice::Unbuffered);
connect (runner.data(), SIGNAL(processStarted()),
this, SLOT(processStarted()));
connect(runner.data(), SIGNAL(processOutputAvailable(const QByteArray &)),
connect (runner, SIGNAL(processStarted()), this, SLOT(processStarted()));
connect(runner, SIGNAL(processOutputAvailable(const QByteArray &)),
this, SLOT(outputAvailable(const QByteArray &)));
connect(runner.data(), SIGNAL(processErrorOutputAvailable(const QByteArray &)),
connect(runner, SIGNAL(processErrorOutputAvailable(const QByteArray &)),
this, SLOT(errorOutputAvailable(const QByteArray &)));
}
SshIODevice::~SshIODevice()
{
delete runner;
}
qint64 SshIODevice::bytesAvailable () const
{
qint64 r = QIODevice::bytesAvailable();
......@@ -139,16 +144,16 @@ void SshIODevice::errorOutputAvailable(const QByteArray &output)
LldbEngineHost::LldbEngineHost(const DebuggerStartParameters &startParameters)
:IPCEngineHost(startParameters)
:IPCEngineHost(startParameters), m_ssh(0)
{
showMessage(QLatin1String("setting up coms"));
if (startParameters.startMode == StartRemoteEngine)
{
m_guestProcess = 0;
Utils::SshRemoteProcessRunner::Ptr runner =
Utils::SshRemoteProcessRunner::create(startParameters.connParams);
connect (runner.data(), SIGNAL(connectionError(Utils::SshError)),
Utils::SshRemoteProcessRunner * const runner =
new Utils::SshRemoteProcessRunner(startParameters.connParams);
connect (runner, SIGNAL(connectionError(Utils::SshError)),
this, SLOT(sshConnectionError(Utils::SshError)));
runner->run(startParameters.serverStartScript.toUtf8());
setGuestDevice(new SshIODevice(runner));
......@@ -193,7 +198,7 @@ LldbEngineHost::~LldbEngineHost()
m_guestProcess->terminate();
m_guestProcess->kill();
}
if (m_ssh.data() && m_ssh->process().data()) {
if (m_ssh && m_ssh->process().data()) {
// TODO: openssh doesn't do that
m_ssh->process()->kill();
......
......@@ -49,7 +49,8 @@ class SshIODevice : public QIODevice
{
Q_OBJECT
public:
SshIODevice(Utils::SshRemoteProcessRunner::Ptr r);
SshIODevice(Utils::SshRemoteProcessRunner *r);
~SshIODevice();
virtual qint64 bytesAvailable () const;
virtual qint64 writeData (const char * data, qint64 maxSize);
virtual qint64 readData (char * data, qint64 maxSize);
......@@ -58,7 +59,7 @@ private slots:
void outputAvailable(const QByteArray &output);
void errorOutputAvailable(const QByteArray &output);
private:
Utils::SshRemoteProcessRunner::Ptr runner;
Utils::SshRemoteProcessRunner *runner;
Utils::SshRemoteProcess::Ptr proc;
int buckethead;
QQueue<QByteArray> buckets;
......@@ -75,7 +76,7 @@ public:
private:
QProcess *m_guestProcess;
Utils::SshRemoteProcessRunner::Ptr m_ssh;
Utils::SshRemoteProcessRunner *m_ssh;
protected:
void nuke();
private slots:
......
......@@ -52,7 +52,8 @@ const char QmlToolingDirectory[] = "/usr/lib/qt4/plugins/qmltooling";
MaddeDeviceTester::MaddeDeviceTester(QObject *parent)
: AbstractLinuxDeviceTester(parent),
m_genericTester(new GenericLinuxDeviceTester(this)),
m_state(Inactive)
m_state(Inactive),
m_processRunner(0)
{
}
......@@ -106,14 +107,15 @@ void MaddeDeviceTester::handleGenericTestFinished(TestResult result)
return;
}
m_processRunner = SshRemoteProcessRunner::create(m_genericTester->connection());
connect(m_processRunner.data(), SIGNAL(connectionError(Utils::SshError)),
delete m_processRunner;
m_processRunner = new SshRemoteProcessRunner(m_genericTester->connection(), this);
connect(m_processRunner, SIGNAL(connectionError(Utils::SshError)),
SLOT(handleConnectionError()));
connect(m_processRunner.data(), SIGNAL(processOutputAvailable(QByteArray)),
connect(m_processRunner, SIGNAL(processOutputAvailable(QByteArray)),
SLOT(handleStdout(QByteArray)));
connect(m_processRunner.data(), SIGNAL(processErrorOutputAvailable(QByteArray)),
connect(m_processRunner, SIGNAL(processErrorOutputAvailable(QByteArray)),
SLOT(handleStderr(QByteArray)));
connect(m_processRunner.data(), SIGNAL(processClosed(int)), SLOT(handleProcessFinished(int)));
connect(m_processRunner, SIGNAL(processClosed(int)), SLOT(handleProcessFinished(int)));
QString qtInfoCmd;
if (m_deviceConfiguration->osType() == QLatin1String(MeeGoOsType)) {
......@@ -282,8 +284,9 @@ QString MaddeDeviceTester::processedQtLibsList()
m_state = Inactive;
disconnect(m_genericTester, 0, this, 0);
if (m_processRunner)
disconnect(m_processRunner.data(), 0, this, 0);
m_processRunner.clear();
disconnect(m_processRunner, 0, this, 0);
delete m_processRunner;
m_processRunner = 0;
emit finished(m_result);
}
......
......@@ -73,7 +73,7 @@ private:
RemoteLinux::GenericLinuxDeviceTester * const m_genericTester;
State m_state;
TestResult m_result;
QSharedPointer<Utils::SshRemoteProcessRunner> m_processRunner;
Utils::SshRemoteProcessRunner *m_processRunner;
QSharedPointer<const RemoteLinux::LinuxDeviceConfiguration> m_deviceConfiguration;
QByteArray m_stdout;
QByteArray m_stderr;
......
......@@ -47,6 +47,7 @@
#include <remotelinux/deploymentinfo.h>
#include <utils/fileutils.h>
#include <utils/qtcassert.h>
#include <utils/ssh/sshremoteprocessrunner.h>
#include <QtCore/QCoreApplication>
#include <QtCore/QDir>
......@@ -67,7 +68,8 @@ MaemoPublisherFremantleFree::MaemoPublisherFremantleFree(const ProjectExplorer::
QObject(parent),
m_project(project),
m_state(Inactive),
m_sshParams(SshConnectionParameters::DefaultProxy)
m_sshParams(SshConnectionParameters::DefaultProxy),
m_uploader(0)
{
m_sshParams.authenticationType = SshConnectionParameters::AuthenticationByKey;
m_sshParams.timeout = 30;
......@@ -383,14 +385,13 @@ void MaemoPublisherFremantleFree::runDpkgBuildPackage()
// webmaster refuses to enable SFTP "for security reasons" ...
void MaemoPublisherFremantleFree::uploadPackage()
{
m_uploader = SshRemoteProcessRunner::create(m_sshParams);
connect(m_uploader.data(), SIGNAL(processStarted()),
SLOT(handleScpStarted()));
connect(m_uploader.data(), SIGNAL(connectionError(Utils::SshError)),
delete m_uploader;
m_uploader = new SshRemoteProcessRunner(m_sshParams, this);
connect(m_uploader, SIGNAL(processStarted()), SLOT(handleScpStarted()));
connect(m_uploader, SIGNAL(connectionError(Utils::SshError)),
SLOT(handleConnectionError()));
connect(m_uploader.data(), SIGNAL(processClosed(int)),
SLOT(handleUploadJobFinished(int)));
connect(m_uploader.data(), SIGNAL(processOutputAvailable(QByteArray)),
connect(m_uploader, SIGNAL(processClosed(int)), SLOT(handleUploadJobFinished(int)));
connect(m_uploader, SIGNAL(processOutputAvailable(QByteArray)),
SLOT(handleScpStdOut(QByteArray)));
emit progressReport(tr("Starting scp ..."));
setState(StartingScp);
......@@ -631,8 +632,9 @@ void MaemoPublisherFremantleFree::setState(State newState)
// TODO: Can we ensure the remote scp exits, e.g. by sending
// an illegal sequence of bytes? (Probably not, if
// we are currently uploading a file.)
disconnect(m_uploader.data(), 0, this, 0);
m_uploader = SshRemoteProcessRunner::Ptr();
disconnect(m_uploader, 0, this, 0);
delete m_uploader;
m_uploader = 0;
break;
default:
break;
......
......@@ -32,7 +32,7 @@
#ifndef MAEMOPUBLISHERFREMANTLEFREE_H
#define MAEMOPUBLISHERFREMANTLEFREE_H
#include <utils/ssh/sshremoteprocessrunner.h>
#include <utils/ssh/sshconnection.h>
#include <QtCore/QObject>
#include <QtCore/QProcess>
......@@ -45,6 +45,10 @@ namespace Qt4ProjectManager {
class Qt4BuildConfiguration;
}
namespace Utils {
class SshRemoteProcessRunner;
}
namespace Madde {
namespace Internal {
......@@ -116,7 +120,7 @@ private:
QProcess *m_process;
Utils::SshConnectionParameters m_sshParams;
QString m_remoteDir;
QSharedPointer<Utils::SshRemoteProcessRunner> m_uploader;
Utils::SshRemoteProcessRunner *m_uploader;
QByteArray m_scpOutput;
QList<QString> m_filesToUpload;
QString m_resultString;
......
......@@ -46,7 +46,7 @@ namespace Madde {
namespace Internal {
MaemoRemoteCopyFacility::MaemoRemoteCopyFacility(QObject *parent) :
QObject(parent), m_isCopying(false)
QObject(parent), m_isCopying(false), m_copyRunner(0)
{
}
......@@ -63,16 +63,14 @@ void MaemoRemoteCopyFacility::copyFiles(const SshConnection::Ptr &connection,
m_deployables = deployables;
m_mountPoint = mountPoint;
m_copyRunner = SshRemoteProcessRunner::create(connection);
connect(m_copyRunner.data(), SIGNAL(connectionError(Utils::SshError)),
SLOT(handleConnectionError()));
connect(m_copyRunner.data(), SIGNAL(processOutputAvailable(QByteArray)),
delete m_copyRunner;
m_copyRunner = new SshRemoteProcessRunner(connection, this);
connect(m_copyRunner, SIGNAL(connectionError(Utils::SshError)), SLOT(handleConnectionError()));
connect(m_copyRunner, SIGNAL(processOutputAvailable(QByteArray)),
SLOT(handleRemoteStdout(QByteArray)));
connect(m_copyRunner.data(),
SIGNAL(processErrorOutputAvailable(QByteArray)),
connect(m_copyRunner, SIGNAL(processErrorOutputAvailable(QByteArray)),
SLOT(handleRemoteStderr(QByteArray)));
connect(m_copyRunner.data(), SIGNAL(processClosed(int)),
SLOT(handleCopyFinished(int)));
connect(m_copyRunner, SIGNAL(processClosed(int)), SLOT(handleCopyFinished(int)));
m_isCopying = true;
copyNextFile();
......@@ -82,8 +80,9 @@ void MaemoRemoteCopyFacility::cancel()
{
Q_ASSERT(m_isCopying);
SshRemoteProcessRunner::Ptr killProcess
= SshRemoteProcessRunner::create(m_copyRunner->connection());
// TODO: Make member as to not waste memory.
SshRemoteProcessRunner * const killProcess
= new SshRemoteProcessRunner(m_copyRunner->connection(), this);
killProcess->run("pkill cp");
setFinished();
}
......@@ -151,8 +150,9 @@ void MaemoRemoteCopyFacility::copyNextFile()
void MaemoRemoteCopyFacility::setFinished()
{
disconnect(m_copyRunner.data(), 0, this, 0);
m_copyRunner.clear();
disconnect(m_copyRunner, 0, this, 0);
delete m_copyRunner;
m_copyRunner = 0;
m_deployables.clear();
m_isCopying = false;
}
......
......@@ -81,11 +81,11 @@ private:
void copyNextFile();
void setFinished();
QSharedPointer<Utils::SshRemoteProcessRunner> m_copyRunner;
Utils::SshRemoteProcessRunner *m_copyRunner;
QSharedPointer<const RemoteLinux::LinuxDeviceConfiguration> m_devConf;
QList<RemoteLinux::DeployableFile> m_deployables;
QString m_mountPoint;
bool m_isCopying;
bool m_isCopying; // TODO: Redundant due to being in sync with m_copyRunner?
};
} // namespace Internal
......
......@@ -47,11 +47,11 @@ enum State { Inactive, Running };
class RemoteLinuxCustomCommandDeployservicePrivate
{
public:
RemoteLinuxCustomCommandDeployservicePrivate() : state(Inactive) { }
RemoteLinuxCustomCommandDeployservicePrivate() : state(Inactive), runner(0) { }
QString commandLine;
State state;
SshRemoteProcessRunner::Ptr runner;
SshRemoteProcessRunner *runner;
};
} // namespace Internal
......@@ -95,12 +95,13 @@ void RemoteLinuxCustomCommandDeployService::doDeploy()
{
QTC_ASSERT(d->state == Inactive, handleDeploymentDone());
d->runner = SshRemoteProcessRunner::create(connection());
connect(d->runner.data(), SIGNAL(processOutputAvailable(QByteArray)),
delete d->runner;
d->runner = new SshRemoteProcessRunner(connection(), this);
connect(d->runner, SIGNAL(processOutputAvailable(QByteArray)),
SLOT(handleStdout(QByteArray)));
connect(d->runner.data(), SIGNAL(processErrorOutputAvailable(QByteArray)),
connect(d->runner, SIGNAL(processErrorOutputAvailable(QByteArray)),
SLOT(handleStderr(QByteArray)));
connect(d->runner.data(), SIGNAL(processClosed(int)), SLOT(handleProcessClosed(int)));
connect(d->runner, SIGNAL(processClosed(int)), SLOT(handleProcessClosed(int)));
emit progressMessage(tr("Starting remote command '%1'...").arg(d->commandLine));
d->state = Running;
......@@ -111,9 +112,10 @@ void RemoteLinuxCustomCommandDeployService::stopDeployment()
{
QTC_ASSERT(d->state == Running, return);
disconnect(d->runner.data(), 0, this, 0);
disconnect(d->runner, 0, this, 0);
d->runner->process()->closeChannel();
d->runner = SshRemoteProcessRunner::Ptr();
delete d->runner;
d->runner = 0;
d->state = Inactive;
handleDeploymentDone();
}
......
......@@ -44,6 +44,7 @@ RemoteLinuxEnvironmentReader::RemoteLinuxEnvironmentReader(RemoteLinuxRunConfigu
, m_stop(false)
, m_devConfig(config->deviceConfig())
, m_runConfig(config)
, m_remoteProcessRunner(0)
{
connect(config, SIGNAL(deviceConfigurationChanged(ProjectExplorer::Target*)),
this, SLOT(handleCurrentDeviceConfigChanged()));
......@@ -61,19 +62,16 @@ void RemoteLinuxEnvironmentReader::start(const QString &environmentSetupCommand)
if (!m_remoteProcessRunner
|| m_remoteProcessRunner->connection()->state() != Utils::SshConnection::Connected
|| m_remoteProcessRunner->connection()->connectionParameters() != m_devConfig->sshParameters()) {
delete m_remoteProcessRunner;
m_remoteProcessRunner
= Utils::SshRemoteProcessRunner::create(m_devConfig->sshParameters());
= new Utils::SshRemoteProcessRunner(m_devConfig->sshParameters(), this);
}
connect(m_remoteProcessRunner.data(),
SIGNAL(connectionError(Utils::SshError)), this,
connect(m_remoteProcessRunner, SIGNAL(connectionError(Utils::SshError)),
SLOT(handleConnectionFailure()));
connect(m_remoteProcessRunner.data(), SIGNAL(processClosed(int)), this,
SLOT(remoteProcessFinished(int)));
connect(m_remoteProcessRunner.data(),
SIGNAL(processOutputAvailable(QByteArray)), this,
connect(m_remoteProcessRunner, SIGNAL(processClosed(int)), SLOT(remoteProcessFinished(int)));
connect(m_remoteProcessRunner, SIGNAL(processOutputAvailable(QByteArray)),
SLOT(remoteOutput(QByteArray)));
connect(m_remoteProcessRunner.data(),
SIGNAL(processErrorOutputAvailable(QByteArray)), this,
connect(m_remoteProcessRunner, SIGNAL(processErrorOutputAvailable(QByteArray)),
SLOT(remoteErrorOutput(QByteArray)));
const QByteArray remoteCall
= QString(environmentSetupCommand + QLatin1String("; env")).toUtf8();
......@@ -85,7 +83,7 @@ void RemoteLinuxEnvironmentReader::stop()
{
m_stop = true;
if (m_remoteProcessRunner)
disconnect(m_remoteProcessRunner.data(), 0, this, 0);
disconnect(m_remoteProcessRunner, 0, this, 0);
}
void RemoteLinuxEnvironmentReader::handleConnectionFailure()
......@@ -93,7 +91,7 @@ void RemoteLinuxEnvironmentReader::handleConnectionFailure()
if (m_stop)
return;
disconnect(m_remoteProcessRunner.data(), 0, this, 0);
disconnect(m_remoteProcessRunner, 0, this, 0);
emit error(tr("Connection error: %1")
.arg(m_remoteProcessRunner->connection()->errorString()));
emit finished();
......@@ -104,7 +102,7 @@ void RemoteLinuxEnvironmentReader::handleCurrentDeviceConfigChanged()
m_devConfig = m_runConfig->deviceConfig();
if (m_remoteProcessRunner)
disconnect(m_remoteProcessRunner.data(), 0, this, 0);
disconnect(m_remoteProcessRunner, 0, this, 0);
m_env.clear();
setFinished();
}
......@@ -118,7 +116,7 @@ void RemoteLinuxEnvironmentReader::remoteProcessFinished(int exitCode)
if (m_stop)
return;
disconnect(m_remoteProcessRunner.data(), 0, this, 0);
disconnect(m_remoteProcessRunner, 0, this, 0);
m_env.clear();
if (exitCode == Utils::SshRemoteProcess::ExitedNormally) {
if (!m_remoteOutput.isEmpty()) {
......
......@@ -80,7 +80,7 @@ private:
Utils::Environment m_env;
QSharedPointer<const LinuxDeviceConfiguration> m_devConfig;
RemoteLinuxRunConfiguration *m_runConfig;
QSharedPointer<Utils::SshRemoteProcessRunner> m_remoteProcessRunner;
Utils::SshRemoteProcessRunner *m_remoteProcessRunner;
};
} // namespace Internal
......
......@@ -45,10 +45,11 @@ namespace Internal {
class AbstractRemoteLinuxPackageInstallerPrivate
{
public:
AbstractRemoteLinuxPackageInstallerPrivate() : isRunning(false) {}
AbstractRemoteLinuxPackageInstallerPrivate() : isRunning(false), installer(0), killProcess(0) {}
bool isRunning;
Utils::SshRemoteProcessRunner::Ptr installer;
Utils::SshRemoteProcessRunner *installer;
Utils::SshRemoteProcessRunner *killProcess;
};
} // namespace Internal
......@@ -70,14 +71,15 @@ void AbstractRemoteLinuxPackageInstaller::installPackage(const SshConnection::Pt
&& !d->isRunning, return);
prepareInstallation();
d->installer = SshRemoteProcessRunner::create(connection);
connect(d->installer.data(), SIGNAL(connectionError(Utils::SshError)),
delete d->installer;
d->installer = new SshRemoteProcessRunner(connection, this);
connect(d->installer, SIGNAL(connectionError(Utils::SshError)),
SLOT(handleConnectionError()));
connect(d->installer.data(), SIGNAL(processOutputAvailable(QByteArray)),
connect(d->installer, SIGNAL(processOutputAvailable(QByteArray)),
SLOT(handleInstallerOutput(QByteArray)));
connect(d->installer.data(), SIGNAL(processErrorOutputAvailable(QByteArray)),
connect(d->installer, SIGNAL(processErrorOutputAvailable(QByteArray)),
SLOT(handleInstallerErrorOutput(QByteArray)));
connect(d->installer.data(), SIGNAL(processClosed(int)), SLOT(handleInstallationFinished(int)));
connect(d->installer, SIGNAL(processClosed(int)), SLOT(handleInstallationFinished(int)));
QString cmdLine = installCommandLine(packageFilePath);
if (removePackageFile)
......@@ -91,9 +93,9 @@ void AbstractRemoteLinuxPackageInstaller::cancelInstallation()
QTC_ASSERT(d->installer && d->installer->connection()->state() == SshConnection::Connected
&& d->isRunning, return);
const SshRemoteProcessRunner::Ptr killProcess
= SshRemoteProcessRunner::create(d->installer->connection());
killProcess->run(cancelInstallationCommandLine().toUtf8());
delete d->killProcess;
d->killProcess = new SshRemoteProcessRunner(d->installer->connection(), this);
d->killProcess->run(cancelInstallationCommandLine().toUtf8());
setFinished();
}
......@@ -134,8 +136,9 @@ void AbstractRemoteLinuxPackageInstaller::handleInstallerErrorOutput(const QByte
void AbstractRemoteLinuxPackageInstaller::setFinished()
{
disconnect(d->installer.data(), 0, this, 0);
d->installer.clear();
disconnect(d->installer, 0, this, 0);
delete d->installer;
d->installer = 0;
d->isRunning = false;
}
......
......@@ -52,13 +52,15 @@ class AbstractRemoteLinuxProcessListPrivate
public:
AbstractRemoteLinuxProcessListPrivate(const LinuxDeviceConfiguration::ConstPtr &devConf)
: deviceConfiguration(devConf),
process(SshRemoteProcessRunner::create(devConf->sshParameters())),
process(new SshRemoteProcessRunner(devConf->sshParameters())),
state(Inactive)
{
}
~AbstractRemoteLinuxProcessListPrivate() { delete process; }
const LinuxDeviceConfiguration::ConstPtr deviceConfiguration;
const SshRemoteProcessRunner::Ptr process;
SshRemoteProcessRunner * const process;
QList<AbstractRemoteLinuxProcessList::RemoteProcess> remoteProcesses;
QByteArray remoteStdout;
QByteArray remoteStderr;
......@@ -204,13 +206,13 @@ void AbstractRemoteLinuxProcessList::handleRemoteProcessFinished(int exitStatus)
void AbstractRemoteLinuxProcessList::startProcess(const QString &cmdLine)
{
connect(d->process.data(), SIGNAL(connectionError(Utils::SshError)),
connect(d->process, SIGNAL(connectionError(Utils::SshError)),
SLOT(handleConnectionError()));
connect(d->process.data(), SIGNAL(processOutputAvailable(QByteArray)),
connect(d->process, SIGNAL(processOutputAvailable(QByteArray)),
SLOT(handleRemoteStdOut(QByteArray)));
connect(d->process.data(), SIGNAL(processErrorOutputAvailable(QByteArray)),
connect(d->process, SIGNAL(processErrorOutputAvailable(QByteArray)),
SLOT(handleRemoteStdErr(QByteArray)));
connect(d->process.data(), SIGNAL(processClosed(int)),
connect(d->process, SIGNAL(processClosed(int)),
SLOT(handleRemoteProcessFinished(int)));
d->remoteStdout.clear();
d->remoteStderr.clear();
......@@ -220,7 +222,7 @@ void AbstractRemoteLinuxProcessList::startProcess(const QString &cmdLine)
void AbstractRemoteLinuxProcessList::setFinished()
{
disconnect(d->process.data(), 0, this, 0);
disconnect(d->process, 0, this, 0);
d->state = Inactive;
}
......
......@@ -45,14 +45,14 @@ namespace Internal {
class RemoteLinuxUsedPortsGathererPrivate
{
public:
RemoteLinuxUsedPortsGathererPrivate() : running(false) {}
RemoteLinuxUsedPortsGathererPrivate() : procRunner(0), running(false) {}
SshRemoteProcessRunner::Ptr procRunner;
SshRemoteProcessRunner *procRunner;
PortList portsToCheck;
QList<int> usedPorts;
QByteArray remoteStdout;
QByteArray remoteStderr;
bool running;