forked from qt-creator/qt-creator
SshDeviceProcess: Use QtcProcess in terminal mode instead of ConsoleProcess
Change-Id: Icf4dac4be19878e6f46547d198a85291db80e02a Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -32,9 +32,9 @@
|
|||||||
#include <ssh/sshconnection.h>
|
#include <ssh/sshconnection.h>
|
||||||
#include <ssh/sshconnectionmanager.h>
|
#include <ssh/sshconnectionmanager.h>
|
||||||
#include <ssh/sshremoteprocess.h>
|
#include <ssh/sshremoteprocess.h>
|
||||||
#include <utils/consoleprocess.h>
|
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
@@ -48,12 +48,12 @@ enum class Signal { Interrupt, Terminate, Kill };
|
|||||||
class SshDeviceProcess::SshDeviceProcessPrivate
|
class SshDeviceProcess::SshDeviceProcessPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SshDeviceProcessPrivate(SshDeviceProcess *q) : q(q) {}
|
SshDeviceProcessPrivate(SshDeviceProcess *q) : q(q), consoleProcess(QtcProcess::TerminalOn) {}
|
||||||
|
|
||||||
SshDeviceProcess * const q;
|
SshDeviceProcess * const q;
|
||||||
QSsh::SshConnection *connection = nullptr;
|
QSsh::SshConnection *connection = nullptr;
|
||||||
QSsh::SshRemoteProcessPtr process;
|
QSsh::SshRemoteProcessPtr process;
|
||||||
ConsoleProcess consoleProcess;
|
QtcProcess consoleProcess;
|
||||||
Runnable runnable;
|
Runnable runnable;
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
QProcess::ExitStatus exitStatus = QProcess::NormalExit;
|
QProcess::ExitStatus exitStatus = QProcess::NormalExit;
|
||||||
@@ -193,11 +193,11 @@ void SshDeviceProcess::handleConnected()
|
|||||||
d->process->requestX11Forwarding(display);
|
d->process->requestX11Forwarding(display);
|
||||||
if (runInTerminal()) {
|
if (runInTerminal()) {
|
||||||
d->process->setUseTerminal(true);
|
d->process->setUseTerminal(true);
|
||||||
connect(&d->consoleProcess, &ConsoleProcess::errorOccurred,
|
connect(&d->consoleProcess, &QtcProcess::errorOccurred,
|
||||||
this, &DeviceProcess::error);
|
this, &DeviceProcess::error);
|
||||||
connect(&d->consoleProcess, &ConsoleProcess::started,
|
connect(&d->consoleProcess, &QtcProcess::started,
|
||||||
this, &SshDeviceProcess::handleProcessStarted);
|
this, &SshDeviceProcess::handleProcessStarted);
|
||||||
connect(&d->consoleProcess, &ConsoleProcess::finished,
|
connect(&d->consoleProcess, &QtcProcess::finished,
|
||||||
this, [this] { handleProcessFinished(d->consoleProcess.errorString()); });
|
this, [this] { handleProcessFinished(d->consoleProcess.errorString()); });
|
||||||
d->consoleProcess.setAbortOnMetaChars(false);
|
d->consoleProcess.setAbortOnMetaChars(false);
|
||||||
d->consoleProcess.setCommand(d->process->fullLocalCommandLine());
|
d->consoleProcess.setCommand(d->process->fullLocalCommandLine());
|
||||||
@@ -357,7 +357,7 @@ void SshDeviceProcess::SshDeviceProcessPrivate::setState(SshDeviceProcess::SshDe
|
|||||||
killOperation->disconnect(q);
|
killOperation->disconnect(q);
|
||||||
killOperation.clear();
|
killOperation.clear();
|
||||||
if (q->runInTerminal())
|
if (q->runInTerminal())
|
||||||
QMetaObject::invokeMethod(&consoleProcess, &ConsoleProcess::stopProcess, Qt::QueuedConnection);
|
QMetaObject::invokeMethod(&consoleProcess, &QtcProcess::stopProcess, Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
killTimer.stop();
|
killTimer.stop();
|
||||||
consoleProcess.disconnect();
|
consoleProcess.disconnect();
|
||||||
|
Reference in New Issue
Block a user