SSH: Don't allow external access to process runner's connection object.

It does not belong to the runner anymore after the process has finished,
so we must prevent anyone from getting a copy.
(This includes a minor API fix for RemoteLinux code that depended on
the connection being available.)

Change-Id: Icc28dc3c820f4c2210bb6fb08171cd6a84534dee
Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
This commit is contained in:
Christian Kandeler
2011-11-09 17:38:19 +01:00
parent bddfae7182
commit 5d5db225a8
14 changed files with 57 additions and 53 deletions

View File

@@ -203,7 +203,7 @@ void StartGdbServerDialog::startGdbServer()
void StartGdbServerDialog::handleConnectionError()
{
d->ui.textBrowser->append(tr("Connection error: %1")
.arg(d->runner.connection()->errorString()));
.arg(d->runner.lastConnectionErrorString()));
emit processAborted();
}
@@ -238,8 +238,7 @@ void StartGdbServerDialog::handleProcessClosed(int status)
void StartGdbServerDialog::startGdbServerOnPort(int port, int pid)
{
LinuxDeviceConfiguration::ConstPtr device = d->currentDevice();
connect(&d->runner, SIGNAL(connectionError(Utils::SshError)),
SLOT(handleConnectionError()));
connect(&d->runner, SIGNAL(connectionError()), SLOT(handleConnectionError()));
connect(&d->runner, SIGNAL(processStarted()), SLOT(handleProcessStarted()));
connect(&d->runner, SIGNAL(processOutputAvailable(QByteArray)),
SLOT(handleProcessOutputAvailable(QByteArray)));