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