ShellCommand: Some style improvements

Change-Id: Ib9c8a7cd9f207b5f2fad9660183703f83d825575
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Andre Hartmann
2020-06-07 14:14:22 +02:00
committed by André Hartmann
parent 0f362115c1
commit 3fa6861e98

View File

@@ -416,12 +416,10 @@ SynchronousProcessResponse ShellCommand::runSynchronous(const CommandLine &cmd,
// connect stderr to the output window if desired // connect stderr to the output window if desired
if (d->m_flags & MergeOutputChannels) { if (d->m_flags & MergeOutputChannels) {
process.setProcessChannelMode(QProcess::MergedChannels); process.setProcessChannelMode(QProcess::MergedChannels);
} else if (d->m_progressiveOutput } else if (d->m_progressiveOutput || !(d->m_flags & SuppressStdErr)) {
|| !(d->m_flags & SuppressStdErr)) {
process.setStdErrBufferedSignalsEnabled(true); process.setStdErrBufferedSignalsEnabled(true);
connect(&process, &SynchronousProcess::stdErrBuffered, connect(&process, &SynchronousProcess::stdErrBuffered,
this, [this, proxy](const QString &text) this, [this, proxy](const QString &text) {
{
if (d->m_progressParser) if (d->m_progressParser)
d->m_progressParser->parseProgress(text); d->m_progressParser->parseProgress(text);
if (!(d->m_flags & SuppressStdErr)) if (!(d->m_flags & SuppressStdErr))
@@ -435,8 +433,7 @@ SynchronousProcessResponse ShellCommand::runSynchronous(const CommandLine &cmd,
if (d->m_progressParser || d->m_progressiveOutput || (d->m_flags & ShowStdOut)) { if (d->m_progressParser || d->m_progressiveOutput || (d->m_flags & ShowStdOut)) {
process.setStdOutBufferedSignalsEnabled(true); process.setStdOutBufferedSignalsEnabled(true);
connect(&process, &SynchronousProcess::stdOutBuffered, connect(&process, &SynchronousProcess::stdOutBuffered,
this, [this, proxy](const QString &text) this, [this, proxy](const QString &text) {
{
if (d->m_progressParser) if (d->m_progressParser)
d->m_progressParser->parseProgress(text); d->m_progressParser->parseProgress(text);
if (d->m_flags & ShowStdOut) if (d->m_flags & ShowStdOut)