summaryrefslogtreecommitdiff
path: root/src/plugins/remotelinux/remotelinuxpackageinstaller.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@nokia.com>2011-10-28 16:10:26 +0200
committerChristian Kandeler <christian.kandeler@nokia.com>2011-10-28 16:27:03 +0200
commit2faf3b2548c6dc1e050f1b57087beb82e444fc8f (patch)
treef6e68fc6643fd7e45bd1ff5bc517dcebb03e1cde /src/plugins/remotelinux/remotelinuxpackageinstaller.cpp
parentc8fc9b33aeebfcb8e718c034ed1d11dd19235619 (diff)
downloadqt-creator-2faf3b2548c6dc1e050f1b57087beb82e444fc8f.tar.gz
SSH: SshRemoteProcessRunner does not need to be a shared pointer.
Change-Id: I49cf2e113d23ebebe0939adbf90a1a88c84998a5 Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
Diffstat (limited to 'src/plugins/remotelinux/remotelinuxpackageinstaller.cpp')
-rw-r--r--src/plugins/remotelinux/remotelinuxpackageinstaller.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/plugins/remotelinux/remotelinuxpackageinstaller.cpp b/src/plugins/remotelinux/remotelinuxpackageinstaller.cpp
index bb9170fe30..d4b22e99a8 100644
--- a/src/plugins/remotelinux/remotelinuxpackageinstaller.cpp
+++ b/src/plugins/remotelinux/remotelinuxpackageinstaller.cpp
@@ -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;
}