forked from qt-creator/qt-creator
SshRemoteProcessRunner: Don't buffer stdOut and stdErr
It's already being buffered inside SshRemoteProcess. Change-Id: Iaee7e9f04f93196a1016d0e2d55a17ee88d35530 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -52,8 +52,6 @@ public:
|
||||
QString m_command;
|
||||
QString m_lastConnectionErrorString;
|
||||
QProcess::ExitStatus m_exitStatus;
|
||||
QByteArray m_stdout;
|
||||
QByteArray m_stderr;
|
||||
int m_exitCode;
|
||||
QString m_processErrorString;
|
||||
State m_state;
|
||||
@@ -116,9 +114,9 @@ void SshRemoteProcessRunner::handleConnected()
|
||||
connect(d->m_process.get(), &SshRemoteProcess::done,
|
||||
this, &SshRemoteProcessRunner::handleProcessFinished);
|
||||
connect(d->m_process.get(), &SshRemoteProcess::readyReadStandardOutput,
|
||||
this, &SshRemoteProcessRunner::handleStdout);
|
||||
this, &SshRemoteProcessRunner::readyReadStandardOutput);
|
||||
connect(d->m_process.get(), &SshRemoteProcess::readyReadStandardError,
|
||||
this, &SshRemoteProcessRunner::handleStderr);
|
||||
this, &SshRemoteProcessRunner::readyReadStandardError);
|
||||
d->m_process->start();
|
||||
}
|
||||
|
||||
@@ -153,18 +151,6 @@ void SshRemoteProcessRunner::handleProcessFinished(const QString &error)
|
||||
emit processClosed(d->m_processErrorString);
|
||||
}
|
||||
|
||||
void SshRemoteProcessRunner::handleStdout()
|
||||
{
|
||||
d->m_stdout += d->m_process->readAllStandardOutput();
|
||||
emit readyReadStandardOutput();
|
||||
}
|
||||
|
||||
void SshRemoteProcessRunner::handleStderr()
|
||||
{
|
||||
d->m_stderr += d->m_process->readAllStandardError();
|
||||
emit readyReadStandardError();
|
||||
}
|
||||
|
||||
void SshRemoteProcessRunner::setState(int newState)
|
||||
{
|
||||
if (d->m_state == newState)
|
||||
@@ -213,16 +199,12 @@ QString SshRemoteProcessRunner::processErrorString() const
|
||||
|
||||
QByteArray SshRemoteProcessRunner::readAllStandardOutput()
|
||||
{
|
||||
const QByteArray data = d->m_stdout;
|
||||
d->m_stdout.clear();
|
||||
return data;
|
||||
return d->m_process.get() ? d->m_process->readAllStandardOutput() : QByteArray();
|
||||
}
|
||||
|
||||
QByteArray SshRemoteProcessRunner::readAllStandardError()
|
||||
{
|
||||
const QByteArray data = d->m_stderr;
|
||||
d->m_stderr.clear();
|
||||
return data;
|
||||
return d->m_process.get() ? d->m_process->readAllStandardError() : QByteArray();
|
||||
}
|
||||
|
||||
void SshRemoteProcessRunner::cancel()
|
||||
|
@@ -65,8 +65,6 @@ private:
|
||||
void handleDisconnected();
|
||||
void handleProcessStarted();
|
||||
void handleProcessFinished(const QString &error);
|
||||
void handleStdout();
|
||||
void handleStderr();
|
||||
void runInternal(const QString &command, const QSsh::SshConnectionParameters &sshParams);
|
||||
void setState(int newState);
|
||||
|
||||
|
Reference in New Issue
Block a user