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_command;
|
||||||
QString m_lastConnectionErrorString;
|
QString m_lastConnectionErrorString;
|
||||||
QProcess::ExitStatus m_exitStatus;
|
QProcess::ExitStatus m_exitStatus;
|
||||||
QByteArray m_stdout;
|
|
||||||
QByteArray m_stderr;
|
|
||||||
int m_exitCode;
|
int m_exitCode;
|
||||||
QString m_processErrorString;
|
QString m_processErrorString;
|
||||||
State m_state;
|
State m_state;
|
||||||
@@ -116,9 +114,9 @@ void SshRemoteProcessRunner::handleConnected()
|
|||||||
connect(d->m_process.get(), &SshRemoteProcess::done,
|
connect(d->m_process.get(), &SshRemoteProcess::done,
|
||||||
this, &SshRemoteProcessRunner::handleProcessFinished);
|
this, &SshRemoteProcessRunner::handleProcessFinished);
|
||||||
connect(d->m_process.get(), &SshRemoteProcess::readyReadStandardOutput,
|
connect(d->m_process.get(), &SshRemoteProcess::readyReadStandardOutput,
|
||||||
this, &SshRemoteProcessRunner::handleStdout);
|
this, &SshRemoteProcessRunner::readyReadStandardOutput);
|
||||||
connect(d->m_process.get(), &SshRemoteProcess::readyReadStandardError,
|
connect(d->m_process.get(), &SshRemoteProcess::readyReadStandardError,
|
||||||
this, &SshRemoteProcessRunner::handleStderr);
|
this, &SshRemoteProcessRunner::readyReadStandardError);
|
||||||
d->m_process->start();
|
d->m_process->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -153,18 +151,6 @@ void SshRemoteProcessRunner::handleProcessFinished(const QString &error)
|
|||||||
emit processClosed(d->m_processErrorString);
|
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)
|
void SshRemoteProcessRunner::setState(int newState)
|
||||||
{
|
{
|
||||||
if (d->m_state == newState)
|
if (d->m_state == newState)
|
||||||
@@ -213,16 +199,12 @@ QString SshRemoteProcessRunner::processErrorString() const
|
|||||||
|
|
||||||
QByteArray SshRemoteProcessRunner::readAllStandardOutput()
|
QByteArray SshRemoteProcessRunner::readAllStandardOutput()
|
||||||
{
|
{
|
||||||
const QByteArray data = d->m_stdout;
|
return d->m_process.get() ? d->m_process->readAllStandardOutput() : QByteArray();
|
||||||
d->m_stdout.clear();
|
|
||||||
return data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray SshRemoteProcessRunner::readAllStandardError()
|
QByteArray SshRemoteProcessRunner::readAllStandardError()
|
||||||
{
|
{
|
||||||
const QByteArray data = d->m_stderr;
|
return d->m_process.get() ? d->m_process->readAllStandardError() : QByteArray();
|
||||||
d->m_stderr.clear();
|
|
||||||
return data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SshRemoteProcessRunner::cancel()
|
void SshRemoteProcessRunner::cancel()
|
||||||
|
@@ -65,8 +65,6 @@ private:
|
|||||||
void handleDisconnected();
|
void handleDisconnected();
|
||||||
void handleProcessStarted();
|
void handleProcessStarted();
|
||||||
void handleProcessFinished(const QString &error);
|
void handleProcessFinished(const QString &error);
|
||||||
void handleStdout();
|
|
||||||
void handleStderr();
|
|
||||||
void runInternal(const QString &command, const QSsh::SshConnectionParameters &sshParams);
|
void runInternal(const QString &command, const QSsh::SshConnectionParameters &sshParams);
|
||||||
void setState(int newState);
|
void setState(int newState);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user