Commit 8a467fcc authored by hjk's avatar hjk
Browse files

ProjectExplorer: Modernize DeviceApplicationRunnuer



Change-Id: Id406fc2bf0449a69faf04d11ce1bdcc13e1fef47
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@theqtcompany.com>
parent 4a5d7f3d
......@@ -33,7 +33,6 @@
#include <utils/qtcassert.h>
#include <QStringList>
#include <QTimer>
using namespace QSsh;
......@@ -106,12 +105,16 @@ void DeviceApplicationRunner::start(const IDevice::ConstPtr &device,
d->success = true;
d->deviceProcess = device->createProcess(this);
connect(d->deviceProcess, SIGNAL(started()), SIGNAL(remoteProcessStarted()));
connect(d->deviceProcess, SIGNAL(readyReadStandardOutput()), SLOT(handleRemoteStdout()));
connect(d->deviceProcess, SIGNAL(readyReadStandardError()), SLOT(handleRemoteStderr()));
connect(d->deviceProcess, SIGNAL(error(QProcess::ProcessError)),
SLOT(handleApplicationError(QProcess::ProcessError)));
connect(d->deviceProcess, SIGNAL(finished()), SLOT(handleApplicationFinished()));
connect(d->deviceProcess, &DeviceProcess::started,
this, &DeviceApplicationRunner::remoteProcessStarted);
connect(d->deviceProcess, &DeviceProcess::readyReadStandardOutput,
this, &DeviceApplicationRunner::handleRemoteStdout);
connect(d->deviceProcess, &DeviceProcess::readyReadStandardError,
this, &DeviceApplicationRunner::handleRemoteStderr);
connect(d->deviceProcess, &DeviceProcess::error,
this, &DeviceApplicationRunner::handleApplicationError);
connect(d->deviceProcess, &DeviceProcess::finished,
this, &DeviceApplicationRunner::handleApplicationFinished);
d->deviceProcess->setEnvironment(d->environment);
d->deviceProcess->setWorkingDirectory(d->workingDir);
d->deviceProcess->start(command, arguments);
......
......@@ -44,9 +44,10 @@ namespace ProjectExplorer {
class PROJECTEXPLORER_EXPORT DeviceApplicationRunner : public QObject
{
Q_OBJECT
public:
explicit DeviceApplicationRunner(QObject *parent = 0);
virtual ~DeviceApplicationRunner();
~DeviceApplicationRunner();
void setEnvironment(const Utils::Environment &env);
void setWorkingDirectory(const QString &workingDirectory);
......@@ -63,13 +64,12 @@ signals:
void remoteProcessStarted();
void finished(bool success);
private slots:
private:
void handleApplicationError(QProcess::ProcessError error);
void handleApplicationFinished();
void handleRemoteStdout();
void handleRemoteStderr();
private:
void doReportError(const QString &message);
void setFinished();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment