Utils: use cleaned stdout all over the place again

Amends 5ee880ce5e

Change-Id: Ie0202db7d8455372c3697087d9571db6706b45a1
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
David Schulz
2022-06-17 14:17:14 +02:00
parent dcd3d9e717
commit 153ff77a6b
48 changed files with 145 additions and 145 deletions

View File

@@ -50,7 +50,7 @@ FilePath BuildableHelperLibrary::qtChooserToQmakePath(const FilePath &qtChooser)
proc.runBlocking(); proc.runBlocking();
if (proc.result() != ProcessResult::FinishedWithSuccess) if (proc.result() != ProcessResult::FinishedWithSuccess)
return {}; return {};
const QString output = proc.stdOut(); const QString output = proc.cleanedStdOut();
int pos = output.indexOf(toolDir); int pos = output.indexOf(toolDir);
if (pos == -1) if (pos == -1)
return {}; return {};

View File

@@ -1051,17 +1051,17 @@ QtcProcess::QtcProcess(QObject *parent)
qCDebug(processLog).nospace() << "Process " << number << " finished: " qCDebug(processLog).nospace() << "Process " << number << " finished: "
<< "result=" << int(result()) << "result=" << int(result())
<< ", ex=" << exitCode() << ", ex=" << exitCode()
<< ", " << stdOut().size() << " bytes stdout: " << ", " << cleanedStdOut().size() << " bytes stdout: "
<< stdOut().left(20) << cleanedStdOut().left(20)
<< ", " << stdErr().size() << " bytes stderr: " << ", " << cleanedStdErr().size() << " bytes stderr: "
<< stdErr().left(1000) << cleanedStdErr().left(1000)
<< ", " << msElapsed << " ms elapsed"; << ", " << msElapsed << " ms elapsed";
if (processStdoutLog().isDebugEnabled() && !stdOut().isEmpty()) if (processStdoutLog().isDebugEnabled() && !cleanedStdOut().isEmpty())
qCDebug(processStdoutLog).nospace() qCDebug(processStdoutLog).nospace()
<< "Process " << number << " sdout: " << stdOut(); << "Process " << number << " sdout: " << cleanedStdOut();
if (processStderrLog().isDebugEnabled() && !stdErr().isEmpty()) if (processStderrLog().isDebugEnabled() && !cleanedStdErr().isEmpty())
qCDebug(processStderrLog).nospace() qCDebug(processStderrLog).nospace()
<< "Process " << number << " stderr: " << stdErr(); << "Process " << number << " stderr: " << cleanedStdErr();
}); });
} }
} }
@@ -1691,8 +1691,8 @@ QString QtcProcess::allOutput() const
{ {
QTC_CHECK(d->m_stdOut.keepRawData); QTC_CHECK(d->m_stdOut.keepRawData);
QTC_CHECK(d->m_stdErr.keepRawData); QTC_CHECK(d->m_stdErr.keepRawData);
const QString out = stdOut(); const QString out = cleanedStdOut();
const QString err = stdErr(); const QString err = cleanedStdErr();
if (!out.isEmpty() && !err.isEmpty()) { if (!out.isEmpty() && !err.isEmpty()) {
QString result = out; QString result = out;
@@ -1748,12 +1748,12 @@ static QStringList splitLines(const QString &text)
const QStringList QtcProcess::stdOutLines() const const QStringList QtcProcess::stdOutLines() const
{ {
return splitLines(stdOut()); return splitLines(cleanedStdOut());
} }
const QStringList QtcProcess::stdErrLines() const const QStringList QtcProcess::stdErrLines() const
{ {
return splitLines(stdErr()); return splitLines(cleanedStdErr());
} }
QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug str, const QtcProcess &r) QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug str, const QtcProcess &r)

View File

@@ -271,8 +271,8 @@ void ShellCommand::run(QFutureInterface<void> &future)
proc.setExitCodeInterpreter(job.exitCodeInterpreter); proc.setExitCodeInterpreter(job.exitCodeInterpreter);
proc.setTimeoutS(job.timeoutS); proc.setTimeoutS(job.timeoutS);
runCommand(proc, job.command, job.workingDirectory); runCommand(proc, job.command, job.workingDirectory);
stdOut += proc.stdOut(); stdOut += proc.cleanedStdOut();
stdErr += proc.stdErr(); stdErr += proc.cleanedStdErr();
d->m_lastExecExitCode = proc.exitCode(); d->m_lastExecExitCode = proc.exitCode();
d->m_lastExecSuccess = proc.result() == ProcessResult::FinishedWithSuccess; d->m_lastExecSuccess = proc.result() == ProcessResult::FinishedWithSuccess;
if (!d->m_lastExecSuccess) if (!d->m_lastExecSuccess)
@@ -352,11 +352,11 @@ void ShellCommand::runFullySynchronous(QtcProcess &process, const FilePath &work
process.runBlocking(); process.runBlocking();
if (!d->m_aborted) { if (!d->m_aborted) {
const QString stdErr = process.stdErr(); const QString stdErr = process.cleanedStdErr();
if (!stdErr.isEmpty() && !(d->m_flags & SuppressStdErr)) if (!stdErr.isEmpty() && !(d->m_flags & SuppressStdErr))
emit append(stdErr); emit append(stdErr);
const QString stdOut = process.stdOut(); const QString stdOut = process.cleanedStdOut();
if (!stdOut.isEmpty() && d->m_flags & ShowStdOut) { if (!stdOut.isEmpty() && d->m_flags & ShowStdOut) {
if (d->m_flags & SilentOutput) if (d->m_flags & SilentOutput)
emit appendSilently(stdOut); emit appendSilently(stdOut);

View File

@@ -1065,7 +1065,7 @@ QAbstractItemModel *AndroidBuildApkStep::keystoreCertificates()
if (keytoolProc.result() > ProcessResult::FinishedWithError) if (keytoolProc.result() > ProcessResult::FinishedWithError)
QMessageBox::critical(nullptr, tr("Error"), tr("Failed to run keytool.")); QMessageBox::critical(nullptr, tr("Error"), tr("Failed to run keytool."));
else else
model = new CertificatesModel(keytoolProc.stdOut(), this); model = new CertificatesModel(keytoolProc.cleanedStdOut(), this);
return model; return model;
} }

View File

@@ -787,8 +787,8 @@ SdkToolResult AndroidManager::runCommand(const CommandLine &command,
qCDebug(androidManagerLog) << "Running command (sync):" << command.toUserOutput(); qCDebug(androidManagerLog) << "Running command (sync):" << command.toUserOutput();
cmdProc.setCommand(command); cmdProc.setCommand(command);
cmdProc.runBlocking(EventLoopMode::On); cmdProc.runBlocking(EventLoopMode::On);
cmdResult.m_stdOut = cmdProc.stdOut().trimmed(); cmdResult.m_stdOut = cmdProc.cleanedStdOut().trimmed();
cmdResult.m_stdErr = cmdProc.stdErr().trimmed(); cmdResult.m_stdErr = cmdProc.cleanedStdErr().trimmed();
cmdResult.m_success = cmdProc.result() == ProcessResult::FinishedWithSuccess; cmdResult.m_success = cmdProc.result() == ProcessResult::FinishedWithSuccess;
qCDebug(androidManagerLog) << "Command finshed (sync):" << command.toUserOutput() qCDebug(androidManagerLog) << "Command finshed (sync):" << command.toUserOutput()
<< "Success:" << cmdResult.m_success << "Success:" << cmdResult.m_success

View File

@@ -186,7 +186,7 @@ static void sdkManagerCommand(const AndroidConfig &config, const QStringList &ar
proc.runBlocking(EventLoopMode::On); proc.runBlocking(EventLoopMode::On);
if (assertionFound) { if (assertionFound) {
output.success = false; output.success = false;
output.stdOutput = proc.stdOut(); output.stdOutput = proc.cleanedStdOut();
output.stdError = QCoreApplication::translate("Android::Internal::AndroidSdkManager", output.stdError = QCoreApplication::translate("Android::Internal::AndroidSdkManager",
"The operation requires user interaction. " "The operation requires user interaction. "
"Use the \"sdkmanager\" command-line tool."); "Use the \"sdkmanager\" command-line tool.");

View File

@@ -153,7 +153,7 @@ bool BazaarClient::synchronousUncommit(const FilePath &workingDir,
QtcProcess proc; QtcProcess proc;
vcsFullySynchronousExec(proc, workingDir, args); vcsFullySynchronousExec(proc, workingDir, args);
VcsOutputWindow::append(proc.stdOut()); VcsOutputWindow::append(proc.cleanedStdOut());
return proc.result() == ProcessResult::FinishedWithSuccess; return proc.result() == ProcessResult::FinishedWithSuccess;
} }

View File

@@ -92,10 +92,10 @@ static int updateVersionHelper(const FilePath &command)
return 0; return 0;
// Astyle prints the version on stdout or stderr, depending on platform // Astyle prints the version on stdout or stderr, depending on platform
const int version = parseVersion(process.stdOut().trimmed()); const int version = parseVersion(process.cleanedStdOut().trimmed());
if (version != 0) if (version != 0)
return version; return version;
return parseVersion(process.stdErr().trimmed()); return parseVersion(process.cleanedStdErr().trimmed());
} }
void ArtisticStyleSettings::updateVersion() void ArtisticStyleSettings::updateVersion()
@@ -204,7 +204,7 @@ void ArtisticStyleSettings::createDocumentationFile() const
stream.writeStartElement(Constants::DOCUMENTATION_XMLROOT); stream.writeStartElement(Constants::DOCUMENTATION_XMLROOT);
// astyle writes its output to 'error'... // astyle writes its output to 'error'...
const QStringList lines = process.stdErr().split(QLatin1Char('\n')); const QStringList lines = process.cleanedStdErr().split(QLatin1Char('\n'));
QStringList keys; QStringList keys;
QStringList docu; QStringList docu;
for (QString line : lines) { for (QString line : lines) {

View File

@@ -88,8 +88,8 @@ public:
private: private:
void handleDone() void handleDone()
{ {
const QString stdOut = m_appRunner.stdOut(); const QString stdOut = m_appRunner.cleanedStdOut();
const QString stdErr = m_appRunner.stdErr(); const QString stdErr = m_appRunner.cleanedStdErr();
// FIXME: Needed in a post-adb world? // FIXME: Needed in a post-adb world?
// adb does not forward exit codes and all stderr goes to stdout. // adb does not forward exit codes and all stderr goes to stdout.

View File

@@ -132,7 +132,7 @@ void ClangToolRunner::onProcessDone()
if (m_process.result() == ProcessResult::StartFailed) { if (m_process.result() == ProcessResult::StartFailed) {
emit finishedWithFailure(generalProcessError(m_name), commandlineAndOutput()); emit finishedWithFailure(generalProcessError(m_name), commandlineAndOutput());
} else if (m_process.result() == ProcessResult::FinishedWithSuccess) { } else if (m_process.result() == ProcessResult::FinishedWithSuccess) {
qCDebug(LOG).noquote() << "Output:\n" << m_process.stdOut(); qCDebug(LOG).noquote() << "Output:\n" << m_process.cleanedStdOut();
emit finishedWithSuccess(m_fileToAnalyze); emit finishedWithSuccess(m_fileToAnalyze);
} else if (m_process.result() == ProcessResult::FinishedWithError) { } else if (m_process.result() == ProcessResult::FinishedWithError) {
emit finishedWithFailure(finishedWithBadExitCode(m_name, m_process.exitCode()), emit finishedWithFailure(finishedWithBadExitCode(m_name, m_process.exitCode()),
@@ -149,7 +149,7 @@ QString ClangToolRunner::commandlineAndOutput() const
"Output:\n%3") "Output:\n%3")
.arg(m_commandLine.toUserOutput()) .arg(m_commandLine.toUserOutput())
.arg(m_process.error()) .arg(m_process.error())
.arg(m_process.stdOut()); .arg(m_process.cleanedStdOut());
} }
} // namespace Internal } // namespace Internal

View File

@@ -63,7 +63,7 @@ static QString runExecutable(const Utils::CommandLine &commandLine, QueryFailMod
return {}; return {};
} }
return cpp.stdOut(); return cpp.cleanedStdOut();
} }
static QStringList queryClangTidyChecks(const FilePath &executable, static QStringList queryClangTidyChecks(const FilePath &executable,

View File

@@ -1676,8 +1676,8 @@ ClearCasePluginPrivate::runCleartool(const FilePath &workingDir,
response.error = proc.result() != ProcessResult::FinishedWithSuccess; response.error = proc.result() != ProcessResult::FinishedWithSuccess;
if (response.error) if (response.error)
response.message = proc.exitMessage(); response.message = proc.exitMessage();
response.stdErr = proc.stdErr(); response.stdErr = proc.cleanedStdErr();
response.stdOut = proc.stdOut(); response.stdOut = proc.cleanedStdOut();
return response; return response;
} }

View File

@@ -280,19 +280,19 @@ TextEditor::Keywords CMakeTool::keywords()
QtcProcess proc; QtcProcess proc;
runCMake(proc, {"--help-command-list"}, 5); runCMake(proc, {"--help-command-list"}, 5);
if (proc.result() == ProcessResult::FinishedWithSuccess) if (proc.result() == ProcessResult::FinishedWithSuccess)
m_introspection->m_functions = proc.stdOut().split('\n'); m_introspection->m_functions = proc.cleanedStdOut().split('\n');
runCMake(proc, {"--help-commands"}, 5); runCMake(proc, {"--help-commands"}, 5);
if (proc.result() == ProcessResult::FinishedWithSuccess) if (proc.result() == ProcessResult::FinishedWithSuccess)
parseFunctionDetailsOutput(proc.stdOut()); parseFunctionDetailsOutput(proc.cleanedStdOut());
runCMake(proc, {"--help-property-list"}, 5); runCMake(proc, {"--help-property-list"}, 5);
if (proc.result() == ProcessResult::FinishedWithSuccess) if (proc.result() == ProcessResult::FinishedWithSuccess)
m_introspection->m_variables = parseVariableOutput(proc.stdOut()); m_introspection->m_variables = parseVariableOutput(proc.cleanedStdOut());
runCMake(proc, {"--help-variable-list"}, 5); runCMake(proc, {"--help-variable-list"}, 5);
if (proc.result() == ProcessResult::FinishedWithSuccess) { if (proc.result() == ProcessResult::FinishedWithSuccess) {
m_introspection->m_variables.append(parseVariableOutput(proc.stdOut())); m_introspection->m_variables.append(parseVariableOutput(proc.cleanedStdOut()));
m_introspection->m_variables = Utils::filteredUnique(m_introspection->m_variables); m_introspection->m_variables = Utils::filteredUnique(m_introspection->m_variables);
Utils::sort(m_introspection->m_variables); Utils::sort(m_introspection->m_variables);
} }
@@ -523,7 +523,7 @@ void CMakeTool::fetchFromCapabilities() const
if (cmake.result() == ProcessResult::FinishedWithSuccess) { if (cmake.result() == ProcessResult::FinishedWithSuccess) {
m_introspection->m_didRun = true; m_introspection->m_didRun = true;
parseFromCapabilities(cmake.stdOut()); parseFromCapabilities(cmake.cleanedStdOut());
} else { } else {
qCCritical(cmakeToolLog) << "Fetching capabilities failed: " << cmake.allOutput() << cmake.error(); qCCritical(cmakeToolLog) << "Fetching capabilities failed: " << cmake.allOutput() << cmake.error();
m_introspection->m_didRun = false; m_introspection->m_didRun = false;

View File

@@ -1449,8 +1449,8 @@ CvsResponse CvsPluginPrivate::runCvs(const FilePath &workingDirectory,
command.runCommand(proc, {executable, m_settings.addOptions(arguments)}); command.runCommand(proc, {executable, m_settings.addOptions(arguments)});
response.result = CvsResponse::OtherError; response.result = CvsResponse::OtherError;
response.stdErr = proc.stdErr(); response.stdErr = proc.cleanedStdErr();
response.stdOut = proc.stdOut(); response.stdOut = proc.cleanedStdOut();
switch (proc.result()) { switch (proc.result()) {
case ProcessResult::FinishedWithSuccess: case ProcessResult::FinishedWithSuccess:
response.result = CvsResponse::Ok; response.result = CvsResponse::Ok;

View File

@@ -5004,7 +5004,7 @@ CoreInfo CoreInfo::readExecutableNameFromCore(const Runnable &debugger, const Fi
proc.runBlocking(); proc.runBlocking();
if (proc.result() == ProcessResult::FinishedWithSuccess) { if (proc.result() == ProcessResult::FinishedWithSuccess) {
QString output = proc.stdOut(); QString output = proc.cleanedStdOut();
// Core was generated by `/data/dev/creator-2.6/bin/qtcreator'. // Core was generated by `/data/dev/creator-2.6/bin/qtcreator'.
// Program terminated with signal 11, Segmentation fault. // Program terminated with signal 11, Segmentation fault.
int pos1 = output.indexOf("Core was generated by"); int pos1 = output.indexOf("Core was generated by");

View File

@@ -444,7 +444,7 @@ void DockerDevicePrivate::startContainer()
if (createProcess.result() != ProcessResult::FinishedWithSuccess) if (createProcess.result() != ProcessResult::FinishedWithSuccess)
return; return;
m_container = createProcess.stdOut().trimmed(); m_container = createProcess.cleanedStdOut().trimmed();
if (m_container.isEmpty()) if (m_container.isEmpty())
return; return;
LOG("Container via process: " << m_container); LOG("Container via process: " << m_container);
@@ -988,11 +988,11 @@ void DockerDevicePrivate::fetchSystemEnviroment()
proc.setCommand(q->withDockerExecCmd({"env", {}})); proc.setCommand(q->withDockerExecCmd({"env", {}}));
proc.start(); proc.start();
proc.waitForFinished(); proc.waitForFinished();
const QString remoteOutput = proc.stdOut(); const QString remoteOutput = proc.cleanedStdOut();
m_cachedEnviroment = Environment(remoteOutput.split('\n', Qt::SkipEmptyParts), q->osType()); m_cachedEnviroment = Environment(remoteOutput.split('\n', Qt::SkipEmptyParts), q->osType());
const QString remoteError = proc.stdErr(); const QString remoteError = proc.cleanedStdErr();
if (!remoteError.isEmpty()) if (!remoteError.isEmpty())
qWarning("Cannot read container environment: %s\n", qPrintable(remoteError)); qWarning("Cannot read container environment: %s\n", qPrintable(remoteError));
} }
@@ -1126,7 +1126,7 @@ public:
}); });
connect(m_process, &Utils::QtcProcess::readyReadStandardError, this, [this] { connect(m_process, &Utils::QtcProcess::readyReadStandardError, this, [this] {
const QString out = DockerDevice::tr("Error: %1").arg(m_process->stdErr()); const QString out = DockerDevice::tr("Error: %1").arg(m_process->cleanedStdErr());
m_log->append(DockerDevice::tr("Error: %1").arg(out)); m_log->append(DockerDevice::tr("Error: %1").arg(out));
}); });

View File

@@ -162,7 +162,7 @@ void ChangeSelectionDialog::setDetails()
QPalette palette; QPalette palette;
if (m_process->result() == ProcessResult::FinishedWithSuccess) { if (m_process->result() == ProcessResult::FinishedWithSuccess) {
m_ui->detailsText->setPlainText(m_process->stdOut()); m_ui->detailsText->setPlainText(m_process->cleanedStdOut());
palette.setColor(QPalette::Text, theme->color(Theme::TextColorNormal)); palette.setColor(QPalette::Text, theme->color(Theme::TextColorNormal));
m_ui->changeNumberEdit->setPalette(palette); m_ui->changeNumberEdit->setPalette(palette);
} else { } else {

View File

@@ -247,7 +247,7 @@ int GerritServer::testConnection()
client->vcsFullySynchronousExec(proc, {}, {curlBinary, arguments}, client->vcsFullySynchronousExec(proc, {}, {curlBinary, arguments},
Core::ShellCommand::NoOutput); Core::ShellCommand::NoOutput);
if (proc.result() == ProcessResult::FinishedWithSuccess) { if (proc.result() == ProcessResult::FinishedWithSuccess) {
QString output = proc.stdOut(); QString output = proc.cleanedStdOut();
// Gerrit returns an empty response for /p/qt-creator/a/accounts/self // Gerrit returns an empty response for /p/qt-creator/a/accounts/self
// so consider this as 404. // so consider this as 404.
if (output.isEmpty()) if (output.isEmpty())
@@ -266,7 +266,7 @@ int GerritServer::testConnection()
if (proc.exitCode() == CertificateError) if (proc.exitCode() == CertificateError)
return CertificateError; return CertificateError;
const QRegularExpression errorRegexp("returned error: (\\d+)"); const QRegularExpression errorRegexp("returned error: (\\d+)");
QRegularExpressionMatch match = errorRegexp.match(proc.stdErr()); QRegularExpressionMatch match = errorRegexp.match(proc.cleanedStdErr());
if (match.hasMatch()) if (match.hasMatch())
return match.captured(1).toInt(); return match.captured(1).toInt();
return UnknownError; return UnknownError;
@@ -346,7 +346,7 @@ bool GerritServer::resolveVersion(const GerritParameters &p, bool forceReload)
arguments << p.portFlag << QString::number(port); arguments << p.portFlag << QString::number(port);
arguments << hostArgument() << "gerrit" << "version"; arguments << hostArgument() << "gerrit" << "version";
client->vcsFullySynchronousExec(proc, {}, {p.ssh, arguments}, Core::ShellCommand::NoOutput); client->vcsFullySynchronousExec(proc, {}, {p.ssh, arguments}, Core::ShellCommand::NoOutput);
QString stdOut = proc.stdOut().trimmed(); QString stdOut = proc.cleanedStdOut().trimmed();
stdOut.remove("gerrit version "); stdOut.remove("gerrit version ");
version = stdOut; version = stdOut;
if (version.isEmpty()) if (version.isEmpty())
@@ -359,7 +359,7 @@ bool GerritServer::resolveVersion(const GerritParameters &p, bool forceReload)
// REST endpoint for version is only available from 2.8 and up. Do not consider invalid // REST endpoint for version is only available from 2.8 and up. Do not consider invalid
// if it fails. // if it fails.
if (proc.result() == ProcessResult::FinishedWithSuccess) { if (proc.result() == ProcessResult::FinishedWithSuccess) {
QString output = proc.stdOut(); QString output = proc.cleanedStdOut();
if (output.isEmpty()) if (output.isEmpty())
return false; return false;
output.remove(0, output.indexOf('\n')); // Strip first line output.remove(0, output.indexOf('\n')); // Strip first line

View File

@@ -761,8 +761,8 @@ public:
// No conflicts => do nothing // No conflicts => do nothing
if (proc.result() == ProcessResult::FinishedWithSuccess) if (proc.result() == ProcessResult::FinishedWithSuccess)
return; return;
handler.readStdOut(proc.stdOut()); handler.readStdOut(proc.cleanedStdOut());
handler.readStdErr(proc.stdErr()); handler.readStdErr(proc.cleanedStdErr());
} }
private: private:
@@ -944,7 +944,7 @@ FilePaths GitClient::unmanagedFiles(const FilePaths &filePaths) const
if (proc.result() != ProcessResult::FinishedWithSuccess) if (proc.result() != ProcessResult::FinishedWithSuccess)
return filePaths; return filePaths;
const QStringList managedFilePaths const QStringList managedFilePaths
= transform(proc.stdOut().split('\0', Qt::SkipEmptyParts), = transform(proc.cleanedStdOut().split('\0', Qt::SkipEmptyParts),
[&wd](const QString &fp) { return wd.absoluteFilePath(fp); }); [&wd](const QString &fp) { return wd.absoluteFilePath(fp); });
const QStringList filtered = Utils::filtered(it.value(), [&managedFilePaths, &wd](const QString &fp) { const QStringList filtered = Utils::filtered(it.value(), [&managedFilePaths, &wd](const QString &fp) {
return !managedFilePaths.contains(wd.absoluteFilePath(fp)); return !managedFilePaths.contains(wd.absoluteFilePath(fp));
@@ -1515,7 +1515,7 @@ void GitClient::recoverDeletedFiles(const FilePath &workingDirectory)
vcsFullySynchronousExec(proc, workingDirectory, {"ls-files", "--deleted"}, vcsFullySynchronousExec(proc, workingDirectory, {"ls-files", "--deleted"},
VcsCommand::SuppressCommandLogging); VcsCommand::SuppressCommandLogging);
if (proc.result() == ProcessResult::FinishedWithSuccess) { if (proc.result() == ProcessResult::FinishedWithSuccess) {
const QString stdOut = proc.stdOut().trimmed(); const QString stdOut = proc.cleanedStdOut().trimmed();
if (stdOut.isEmpty()) { if (stdOut.isEmpty()) {
VcsOutputWindow::appendError(tr("Nothing to recover")); VcsOutputWindow::appendError(tr("Nothing to recover"));
return; return;
@@ -1542,11 +1542,11 @@ bool GitClient::synchronousLog(const FilePath &workingDirectory, const QStringLi
vcsFullySynchronousExec(proc, workingDirectory, allArguments, flags, vcsTimeoutS(), vcsFullySynchronousExec(proc, workingDirectory, allArguments, flags, vcsTimeoutS(),
encoding(workingDirectory, "i18n.logOutputEncoding")); encoding(workingDirectory, "i18n.logOutputEncoding"));
if (proc.result() == ProcessResult::FinishedWithSuccess) { if (proc.result() == ProcessResult::FinishedWithSuccess) {
*output = proc.stdOut(); *output = proc.cleanedStdOut();
return true; return true;
} else { } else {
msgCannotRun(tr("Cannot obtain log of \"%1\": %2") msgCannotRun(tr("Cannot obtain log of \"%1\": %2")
.arg(workingDirectory.toUserOutput(), proc.stdErr()), errorMessageIn); .arg(workingDirectory.toUserOutput(), proc.cleanedStdErr()), errorMessageIn);
return false; return false;
} }
} }
@@ -1596,7 +1596,7 @@ bool GitClient::synchronousReset(const FilePath &workingDirectory,
QtcProcess proc; QtcProcess proc;
vcsFullySynchronousExec(proc, workingDirectory, arguments); vcsFullySynchronousExec(proc, workingDirectory, arguments);
const QString stdOut = proc.stdOut(); const QString stdOut = proc.cleanedStdOut();
VcsOutputWindow::append(stdOut); VcsOutputWindow::append(stdOut);
// Note that git exits with 1 even if the operation is successful // Note that git exits with 1 even if the operation is successful
// Assume real failure if the output does not contain "foo.cpp modified" // Assume real failure if the output does not contain "foo.cpp modified"
@@ -1604,10 +1604,10 @@ bool GitClient::synchronousReset(const FilePath &workingDirectory,
if (proc.result() != ProcessResult::FinishedWithSuccess if (proc.result() != ProcessResult::FinishedWithSuccess
&& (!stdOut.contains("modified") && !stdOut.contains("Unstaged changes after reset"))) { && (!stdOut.contains("modified") && !stdOut.contains("Unstaged changes after reset"))) {
if (files.isEmpty()) { if (files.isEmpty()) {
msgCannotRun(arguments, workingDirectory, proc.stdErr(), errorMessage); msgCannotRun(arguments, workingDirectory, proc.cleanedStdErr(), errorMessage);
} else { } else {
msgCannotRun(tr("Cannot reset %n files in \"%1\": %2", nullptr, files.size()) msgCannotRun(tr("Cannot reset %n files in \"%1\": %2", nullptr, files.size())
.arg(workingDirectory.toUserOutput(), proc.stdErr()), .arg(workingDirectory.toUserOutput(), proc.cleanedStdErr()),
errorMessage); errorMessage);
} }
return false; return false;
@@ -1621,7 +1621,7 @@ bool GitClient::synchronousInit(const FilePath &workingDirectory)
QtcProcess proc; QtcProcess proc;
vcsFullySynchronousExec(proc, workingDirectory, QStringList{"init"}); vcsFullySynchronousExec(proc, workingDirectory, QStringList{"init"});
// '[Re]Initialized...' // '[Re]Initialized...'
VcsOutputWindow::append(proc.stdOut()); VcsOutputWindow::append(proc.cleanedStdOut());
if (proc.result() == ProcessResult::FinishedWithSuccess) { if (proc.result() == ProcessResult::FinishedWithSuccess) {
resetCachedVcsInfo(workingDirectory); resetCachedVcsInfo(workingDirectory);
return true; return true;
@@ -1653,7 +1653,7 @@ bool GitClient::synchronousCheckoutFiles(const FilePath &workingDirectory, QStri
//: Meaning of the arguments: %1: revision, %2: files, %3: repository, //: Meaning of the arguments: %1: revision, %2: files, %3: repository,
//: %4: Error message //: %4: Error message
msgCannotRun(tr("Cannot checkout \"%1\" of %2 in \"%3\": %4") msgCannotRun(tr("Cannot checkout \"%1\" of %2 in \"%3\": %4")
.arg(revision, fileArg, workingDirectory.toUserOutput(), proc.stdErr()), .arg(revision, fileArg, workingDirectory.toUserOutput(), proc.cleanedStdErr()),
errorMessage); errorMessage);
return false; return false;
} }
@@ -1701,10 +1701,10 @@ bool GitClient::synchronousRevListCmd(const FilePath &workingDirectory, const QS
QtcProcess proc; QtcProcess proc;
vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags); vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags);
if (proc.result() != ProcessResult::FinishedWithSuccess) { if (proc.result() != ProcessResult::FinishedWithSuccess) {
msgCannotRun(arguments, workingDirectory, proc.stdErr(), errorMessage); msgCannotRun(arguments, workingDirectory, proc.cleanedStdErr(), errorMessage);
return false; return false;
} }
*output = proc.stdOut(); *output = proc.cleanedStdOut();
return true; return true;
} }
@@ -1765,7 +1765,7 @@ QString GitClient::synchronousCurrentLocalBranch(const FilePath &workingDirector
QtcProcess proc; QtcProcess proc;
vcsFullySynchronousExec(proc, workingDirectory, {"symbolic-ref", HEAD}, silentFlags); vcsFullySynchronousExec(proc, workingDirectory, {"symbolic-ref", HEAD}, silentFlags);
if (proc.result() == ProcessResult::FinishedWithSuccess) { if (proc.result() == ProcessResult::FinishedWithSuccess) {
branch = proc.stdOut().trimmed(); branch = proc.cleanedStdOut().trimmed();
} else { } else {
const QString gitDir = findGitDirForRepository(workingDirectory); const QString gitDir = findGitDirForRepository(workingDirectory);
const QString rebaseHead = gitDir + "/rebase-merge/head-name"; const QString rebaseHead = gitDir + "/rebase-merge/head-name";
@@ -1790,11 +1790,11 @@ bool GitClient::synchronousHeadRefs(const FilePath &workingDirectory, QStringLis
QtcProcess proc; QtcProcess proc;
vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags); vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags);
if (proc.result() != ProcessResult::FinishedWithSuccess) { if (proc.result() != ProcessResult::FinishedWithSuccess) {
msgCannotRun(arguments, workingDirectory, proc.stdErr(), errorMessage); msgCannotRun(arguments, workingDirectory, proc.cleanedStdErr(), errorMessage);
return false; return false;
} }
const QString stdOut = proc.stdOut(); const QString stdOut = proc.cleanedStdOut();
const QString headSha = stdOut.left(10); const QString headSha = stdOut.left(10);
QString rest = stdOut.mid(15); QString rest = stdOut.mid(15);
@@ -1839,7 +1839,7 @@ QString GitClient::synchronousTopic(const FilePath &workingDirectory) const
QtcProcess proc; QtcProcess proc;
vcsFullySynchronousExec(proc, workingDirectory, QStringList{"describe"}, VcsCommand::NoOutput); vcsFullySynchronousExec(proc, workingDirectory, QStringList{"describe"}, VcsCommand::NoOutput);
if (proc.result() == ProcessResult::FinishedWithSuccess) { if (proc.result() == ProcessResult::FinishedWithSuccess) {
const QString stdOut = proc.stdOut().trimmed(); const QString stdOut = proc.cleanedStdOut().trimmed();
if (!stdOut.isEmpty()) if (!stdOut.isEmpty())
return stdOut; return stdOut;
} }
@@ -1852,9 +1852,9 @@ bool GitClient::synchronousRevParseCmd(const FilePath &workingDirectory, const Q
const QStringList arguments = {"rev-parse", ref}; const QStringList arguments = {"rev-parse", ref};
QtcProcess proc; QtcProcess proc;
vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags); vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags);
*output = proc.stdOut().trimmed(); *output = proc.cleanedStdOut().trimmed();
if (proc.result() != ProcessResult::FinishedWithSuccess) { if (proc.result() != ProcessResult::FinishedWithSuccess) {
msgCannotRun(arguments, workingDirectory, proc.stdErr(), errorMessage); msgCannotRun(arguments, workingDirectory, proc.cleanedStdErr(), errorMessage);
return false; return false;
} }
@@ -1869,7 +1869,7 @@ QString GitClient::synchronousTopRevision(const FilePath &workingDirectory, QDat
vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags); vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags);
if (proc.result() != ProcessResult::FinishedWithSuccess) if (proc.result() != ProcessResult::FinishedWithSuccess)
return QString(); return QString();
const QStringList output = proc.stdOut().trimmed().split(':'); const QStringList output = proc.cleanedStdOut().trimmed().split(':');
if (dateTime && output.size() > 1) { if (dateTime && output.size() > 1) {
bool ok = false; bool ok = false;
const qint64 timeT = output.at(1).toLongLong(&ok); const qint64 timeT = output.at(1).toLongLong(&ok);
@@ -1889,7 +1889,7 @@ bool GitClient::isFastForwardMerge(const FilePath &workingDirectory, const QStri
{ {
QtcProcess proc; QtcProcess proc;
vcsFullySynchronousExec(proc, workingDirectory, {"merge-base", HEAD, branch}, silentFlags); vcsFullySynchronousExec(proc, workingDirectory, {"merge-base", HEAD, branch}, silentFlags);
return proc.stdOut().trimmed() == synchronousTopRevision(workingDirectory); return proc.cleanedStdOut().trimmed() == synchronousTopRevision(workingDirectory);
} }
// Format an entry in a one-liner for selection list using git log. // Format an entry in a one-liner for selection list using git log.
@@ -1902,10 +1902,10 @@ QString GitClient::synchronousShortDescription(const FilePath &workingDirectory,
vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags); vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags);
if (proc.result() != ProcessResult::FinishedWithSuccess) { if (proc.result() != ProcessResult::FinishedWithSuccess) {
VcsOutputWindow::appendSilently(tr("Cannot describe revision \"%1\" in \"%2\": %3") VcsOutputWindow::appendSilently(tr("Cannot describe revision \"%1\" in \"%2\": %3")
.arg(revision, workingDirectory.toUserOutput(), proc.stdErr())); .arg(revision, workingDirectory.toUserOutput(), proc.cleanedStdErr()));
return revision; return revision;
} }
return stripLastNewline(proc.stdOut()); return stripLastNewline(proc.cleanedStdOut());
} }
// Create a default message to be used for describing stashes // Create a default message to be used for describing stashes
@@ -1982,7 +1982,7 @@ bool GitClient::executeSynchronousStash(const FilePath &workingDirectory,
QtcProcess proc; QtcProcess proc;
vcsSynchronousExec(proc, workingDirectory, arguments, flags); vcsSynchronousExec(proc, workingDirectory, arguments, flags);
if (proc.result() != ProcessResult::FinishedWithSuccess) { if (proc.result() != ProcessResult::FinishedWithSuccess) {
msgCannotRun(arguments, workingDirectory, proc.stdErr(), errorMessage); msgCannotRun(arguments, workingDirectory, proc.cleanedStdErr(), errorMessage);
return false; return false;
} }
@@ -2021,9 +2021,9 @@ bool GitClient::synchronousBranchCmd(const FilePath &workingDirectory, QStringLi
branchArgs.push_front("branch"); branchArgs.push_front("branch");
QtcProcess proc; QtcProcess proc;
vcsFullySynchronousExec(proc, workingDirectory, branchArgs); vcsFullySynchronousExec(proc, workingDirectory, branchArgs);
*output = proc.stdOut(); *output = proc.cleanedStdOut();
if (proc.result() != ProcessResult::FinishedWithSuccess) { if (proc.result() != ProcessResult::FinishedWithSuccess) {
msgCannotRun(branchArgs, workingDirectory, proc.stdErr(), errorMessage); msgCannotRun(branchArgs, workingDirectory, proc.cleanedStdErr(), errorMessage);
return false; return false;
} }
return true; return true;
@@ -2035,9 +2035,9 @@ bool GitClient::synchronousTagCmd(const FilePath &workingDirectory, QStringList
tagArgs.push_front("tag"); tagArgs.push_front("tag");
QtcProcess proc; QtcProcess proc;
vcsFullySynchronousExec(proc, workingDirectory, tagArgs); vcsFullySynchronousExec(proc, workingDirectory, tagArgs);
*output = proc.stdOut(); *output = proc.cleanedStdOut();
if (proc.result() != ProcessResult::FinishedWithSuccess) { if (proc.result() != ProcessResult::FinishedWithSuccess) {
msgCannotRun(tagArgs, workingDirectory, proc.stdErr(), errorMessage); msgCannotRun(tagArgs, workingDirectory, proc.cleanedStdErr(), errorMessage);
return false; return false;
} }
return true; return true;
@@ -2049,9 +2049,9 @@ bool GitClient::synchronousForEachRefCmd(const FilePath &workingDirectory, QStri
args.push_front("for-each-ref"); args.push_front("for-each-ref");
QtcProcess proc; QtcProcess proc;
vcsFullySynchronousExec(proc, workingDirectory, args, silentFlags); vcsFullySynchronousExec(proc, workingDirectory, args, silentFlags);
*output = proc.stdOut(); *output = proc.cleanedStdOut();
if (proc.result() != ProcessResult::FinishedWithSuccess) { if (proc.result() != ProcessResult::FinishedWithSuccess) {
msgCannotRun(args, workingDirectory, proc.stdErr(), errorMessage); msgCannotRun(args, workingDirectory, proc.cleanedStdErr(), errorMessage);
return false; return false;
} }
return true; return true;
@@ -2070,9 +2070,9 @@ bool GitClient::synchronousRemoteCmd(const FilePath &workingDirectory, QStringLi
QtcProcess proc; QtcProcess proc;
vcsFullySynchronousExec(proc, workingDirectory, remoteArgs, silent ? silentFlags : 0); vcsFullySynchronousExec(proc, workingDirectory, remoteArgs, silent ? silentFlags : 0);
const QString stdErr = proc.stdErr(); const QString stdErr = proc.cleanedStdErr();
*errorMessage = stdErr; *errorMessage = stdErr;
*output = proc.stdOut(); *output = proc.cleanedStdOut();
if (proc.result() != ProcessResult::FinishedWithSuccess) { if (proc.result() != ProcessResult::FinishedWithSuccess) {
msgCannotRun(remoteArgs, workingDirectory, stdErr, errorMessage); msgCannotRun(remoteArgs, workingDirectory, stdErr, errorMessage);
@@ -2116,10 +2116,10 @@ QStringList GitClient::synchronousSubmoduleStatus(const FilePath &workingDirecto
if (proc.result() != ProcessResult::FinishedWithSuccess) { if (proc.result() != ProcessResult::FinishedWithSuccess) {
msgCannotRun(tr("Cannot retrieve submodule status of \"%1\": %2") msgCannotRun(tr("Cannot retrieve submodule status of \"%1\": %2")
.arg(workingDirectory.toUserOutput(), proc.stdErr()), errorMessage); .arg(workingDirectory.toUserOutput(), proc.cleanedStdErr()), errorMessage);
return QStringList(); return QStringList();
} }
return splitLines(proc.stdOut()); return splitLines(proc.cleanedStdOut());
} }
SubmoduleDataMap GitClient::submoduleList(const FilePath &workingDirectory) const SubmoduleDataMap GitClient::submoduleList(const FilePath &workingDirectory) const
@@ -2195,7 +2195,7 @@ QByteArray GitClient::synchronousShow(const FilePath &workingDirectory, const QS
QtcProcess proc; QtcProcess proc;
vcsFullySynchronousExec(proc, workingDirectory, arguments, flags); vcsFullySynchronousExec(proc, workingDirectory, arguments, flags);
if (proc.result() != ProcessResult::FinishedWithSuccess) { if (proc.result() != ProcessResult::FinishedWithSuccess) {
msgCannotRun(arguments, workingDirectory, proc.stdErr(), nullptr); msgCannotRun(arguments, workingDirectory, proc.cleanedStdErr(), nullptr);
return {}; return {};
} }
return proc.rawStdOut(); return proc.rawStdOut();
@@ -2211,7 +2211,7 @@ bool GitClient::cleanList(const FilePath &workingDirectory, const QString &modul
QtcProcess proc; QtcProcess proc;
vcsFullySynchronousExec(proc, directory, arguments, VcsCommand::ForceCLocale); vcsFullySynchronousExec(proc, directory, arguments, VcsCommand::ForceCLocale);
if (proc.result() != ProcessResult::FinishedWithSuccess) { if (proc.result() != ProcessResult::FinishedWithSuccess) {
msgCannotRun(arguments, directory, proc.stdErr(), errorMessage); msgCannotRun(arguments, directory, proc.cleanedStdErr(), errorMessage);
return false; return false;
} }
@@ -2219,7 +2219,7 @@ bool GitClient::cleanList(const FilePath &workingDirectory, const QString &modul
const QString relativeBase = modulePath.isEmpty() ? QString() : modulePath + '/'; const QString relativeBase = modulePath.isEmpty() ? QString() : modulePath + '/';
const QString prefix = "Would remove "; const QString prefix = "Would remove ";
const QStringList removeLines = Utils::filtered( const QStringList removeLines = Utils::filtered(
splitLines(proc.stdOut()), [](const QString &s) { splitLines(proc.cleanedStdOut()), [](const QString &s) {
return s.startsWith("Would remove "); return s.startsWith("Would remove ");
}); });
*files = Utils::transform(removeLines, [&relativeBase, &prefix](const QString &s) -> QString { *files = Utils::transform(removeLines, [&relativeBase, &prefix](const QString &s) -> QString {
@@ -2257,7 +2257,7 @@ bool GitClient::synchronousApplyPatch(const FilePath &workingDirectory,
QtcProcess proc; QtcProcess proc;
vcsFullySynchronousExec(proc, workingDirectory, arguments); vcsFullySynchronousExec(proc, workingDirectory, arguments);
const QString stdErr = proc.stdErr(); const QString stdErr = proc.cleanedStdErr();
if (proc.result() == ProcessResult::FinishedWithSuccess) { if (proc.result() == ProcessResult::FinishedWithSuccess) {
if (!stdErr.isEmpty()) if (!stdErr.isEmpty())
*errorMessage = tr("There were warnings while applying \"%1\" to \"%2\":\n%3") *errorMessage = tr("There were warnings while applying \"%1\" to \"%2\":\n%3")
@@ -2394,7 +2394,7 @@ GitClient::StatusResult GitClient::gitStatus(const FilePath &workingDirectory, S
QtcProcess proc; QtcProcess proc;
vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags); vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags);
const QString stdOut = proc.stdOut(); const QString stdOut = proc.cleanedStdOut();
if (output) if (output)
*output = stdOut; *output = stdOut;
@@ -2404,7 +2404,7 @@ GitClient::StatusResult GitClient::gitStatus(const FilePath &workingDirectory, S
// Is it something really fatal? // Is it something really fatal?
if (!statusRc && !branchKnown) { if (!statusRc && !branchKnown) {
if (errorMessage) { if (errorMessage) {
*errorMessage = tr("Cannot obtain status: %1").arg(proc.stdErr()); *errorMessage = tr("Cannot obtain status: %1").arg(proc.cleanedStdErr());
} }
return StatusFailed; return StatusFailed;
} }
@@ -2547,7 +2547,7 @@ QStringList GitClient::synchronousRepositoryBranches(const QString &repositoryUR
// split "82bfad2f51d34e98b18982211c82220b8db049b<tab>refs/heads/master" // split "82bfad2f51d34e98b18982211c82220b8db049b<tab>refs/heads/master"
bool headFound = false; bool headFound = false;
bool branchFound = false; bool branchFound = false;
const QStringList lines = proc.stdOut().split('\n'); const QStringList lines = proc.cleanedStdOut().split('\n');
for (const QString &line : lines) { for (const QString &line : lines) {
if (line.endsWith("\tHEAD")) { if (line.endsWith("\tHEAD")) {
QTC_CHECK(headSha.isNull()); QTC_CHECK(headSha.isNull());
@@ -3179,7 +3179,7 @@ void GitClient::synchronousAbortCommand(const FilePath &workingDir, const QStrin
QtcProcess proc; QtcProcess proc;
vcsFullySynchronousExec(proc, workingDir, {abortCommand, "--abort"}, vcsFullySynchronousExec(proc, workingDir, {abortCommand, "--abort"},
VcsCommand::ExpectRepoChanges | VcsCommand::ShowSuccessMessage); VcsCommand::ExpectRepoChanges | VcsCommand::ShowSuccessMessage);
VcsOutputWindow::append(proc.stdOut()); VcsOutputWindow::append(proc.cleanedStdOut());
} }
QString GitClient::synchronousTrackingBranch(const FilePath &workingDirectory, const QString &branch) QString GitClient::synchronousTrackingBranch(const FilePath &workingDirectory, const QString &branch)
@@ -3529,12 +3529,12 @@ bool GitClient::synchronousStashRemove(const FilePath &workingDirectory, const Q
QtcProcess proc; QtcProcess proc;
vcsFullySynchronousExec(proc, workingDirectory, arguments); vcsFullySynchronousExec(proc, workingDirectory, arguments);
if (proc.result() == ProcessResult::FinishedWithSuccess) { if (proc.result() == ProcessResult::FinishedWithSuccess) {
const QString output = proc.stdOut(); const QString output = proc.cleanedStdOut();
if (!output.isEmpty()) if (!output.isEmpty())
VcsOutputWindow::append(output); VcsOutputWindow::append(output);
return true; return true;
} else { } else {
msgCannotRun(arguments, workingDirectory, proc.stdErr(), errorMessage); msgCannotRun(arguments, workingDirectory, proc.cleanedStdErr(), errorMessage);
return false; return false;
} }
} }
@@ -3548,11 +3548,11 @@ bool GitClient::synchronousStashList(const FilePath &workingDirectory, QList<Sta
QtcProcess proc; QtcProcess proc;
vcsFullySynchronousExec(proc, workingDirectory, arguments, VcsCommand::ForceCLocale); vcsFullySynchronousExec(proc, workingDirectory, arguments, VcsCommand::ForceCLocale);
if (proc.result() != ProcessResult::FinishedWithSuccess) { if (proc.result() != ProcessResult::FinishedWithSuccess) {
msgCannotRun(arguments, workingDirectory, proc.stdErr(), errorMessage); msgCannotRun(arguments, workingDirectory, proc.cleanedStdErr(), errorMessage);
return false; return false;
} }
Stash stash; Stash stash;
const QStringList lines = splitLines(proc.stdOut()); const QStringList lines = splitLines(proc.cleanedStdOut());
for (const QString &line : lines) { for (const QString &line : lines) {
if (stash.parseStashLine(line)) if (stash.parseStashLine(line))
stashes->push_back(stash); stashes->push_back(stash);
@@ -3589,7 +3589,7 @@ QString GitClient::readOneLine(const FilePath &workingDirectory, const QStringLi
vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags, vcsTimeoutS(), codec); vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags, vcsTimeoutS(), codec);
if (proc.result() != ProcessResult::FinishedWithSuccess) if (proc.result() != ProcessResult::FinishedWithSuccess)
return QString(); return QString();
return proc.stdOut().trimmed(); return proc.cleanedStdOut().trimmed();
} }
// determine version as '(major << 16) + (minor << 8) + patch' or 0. // determine version as '(major << 16) + (minor << 8) + patch' or 0.
@@ -3615,13 +3615,13 @@ unsigned GitClient::synchronousGitVersion(QString *errorMessage) const
QtcProcess proc; QtcProcess proc;
vcsSynchronousExec(proc, {}, {"--version"}, silentFlags); vcsSynchronousExec(proc, {}, {"--version"}, silentFlags);
if (proc.result() != ProcessResult::FinishedWithSuccess) { if (proc.result() != ProcessResult::FinishedWithSuccess) {
msgCannotRun(tr("Cannot determine Git version: %1").arg(proc.stdErr()), errorMessage); msgCannotRun(tr("Cannot determine Git version: %1").arg(proc.cleanedStdErr()), errorMessage);
return 0; return 0;
} }
// cut 'git version 1.6.5.1.sha' // cut 'git version 1.6.5.1.sha'
// another form: 'git version 1.9.rc1' // another form: 'git version 1.9.rc1'
const QString output = proc.stdOut(); const QString output = proc.cleanedStdOut();
const QRegularExpression versionPattern("^[^\\d]+(\\d+)\\.(\\d+)\\.(\\d+|rc\\d).*$"); const QRegularExpression versionPattern("^[^\\d]+(\\d+)\\.(\\d+)\\.(\\d+|rc\\d).*$");
QTC_ASSERT(versionPattern.isValid(), return 0); QTC_ASSERT(versionPattern.isValid(), return 0);
const QRegularExpressionMatch match = versionPattern.match(output); const QRegularExpressionMatch match = versionPattern.match(output);

View File

@@ -238,7 +238,7 @@ static QByteArray decodeProvisioningProfile(const QString &path)
p.runBlocking(); p.runBlocking();
if (p.result() != ProcessResult::FinishedWithSuccess) if (p.result() != ProcessResult::FinishedWithSuccess)
qCDebug(iosCommonLog) << "Reading signed provisioning file failed" << path; qCDebug(iosCommonLog) << "Reading signed provisioning file failed" << path;
return p.stdOut().toLatin1(); return p.cleanedStdOut().toLatin1();
} }
void IosConfigurations::updateAutomaticKitList() void IosConfigurations::updateAutomaticKitList()

View File

@@ -72,7 +72,7 @@ void XcodeProbe::detectDeveloperPaths()
qCWarning(probeLog) qCWarning(probeLog)
<< QString::fromLatin1("Could not detect selected Xcode using xcode-select"); << QString::fromLatin1("Could not detect selected Xcode using xcode-select");
else else
addDeveloperPath(selectedXcode.stdOut().trimmed()); addDeveloperPath(selectedXcode.cleanedStdOut().trimmed());
addDeveloperPath(defaultDeveloperPath); addDeveloperPath(defaultDeveloperPath);
} }

View File

@@ -85,7 +85,7 @@ static bool runCommand(const CommandLine &command, QString *stdOutput, QString *
p.setCommand(command); p.setCommand(command);
p.runBlocking(); p.runBlocking();
if (stdOutput) if (stdOutput)
*stdOutput = p.stdOut(); *stdOutput = p.cleanedStdOut();
if (allOutput) if (allOutput)
*allOutput = p.allOutput(); *allOutput = p.allOutput();
return p.result() == ProcessResult::FinishedWithSuccess; return p.result() == ProcessResult::FinishedWithSuccess;

View File

@@ -103,7 +103,7 @@ bool MercurialClient::manifestSync(const FilePath &repository, const QString &re
const QDir repositoryDir(repository.toString()); const QDir repositoryDir(repository.toString());
const QFileInfo needle = QFileInfo(repositoryDir, relativeFilename); const QFileInfo needle = QFileInfo(repositoryDir, relativeFilename);
const QStringList files = proc.stdOut().split(QLatin1Char('\n')); const QStringList files = proc.cleanedStdOut().split(QLatin1Char('\n'));
for (const QString &fileName : files) { for (const QString &fileName : files) {
const QFileInfo managedFile(repositoryDir, fileName); const QFileInfo managedFile(repositoryDir, fileName);
if (needle == managedFile) if (needle == managedFile)
@@ -186,7 +186,7 @@ bool MercurialClient::synchronousPull(const FilePath &workingDir, const QString
const bool ok = proc.result() == ProcessResult::FinishedWithSuccess; const bool ok = proc.result() == ProcessResult::FinishedWithSuccess;
parsePullOutput(proc.stdOut().trimmed()); parsePullOutput(proc.cleanedStdOut().trimmed());
return ok; return ok;
} }
@@ -232,16 +232,16 @@ changeset: 0:031a48610fba
user: ... user: ...
\endcode */ \endcode */
// Obtain first line and split by blank-delimited tokens // Obtain first line and split by blank-delimited tokens
const QStringList lines = proc.stdOut().split(QLatin1Char('\n')); const QStringList lines = proc.cleanedStdOut().split(QLatin1Char('\n'));
if (lines.size() < 1) { if (lines.size() < 1) {
VcsOutputWindow::appendSilently( VcsOutputWindow::appendSilently(
msgParentRevisionFailed(workingDirectory, revision, msgParseParentsOutputFailed(proc.stdOut()))); msgParentRevisionFailed(workingDirectory, revision, msgParseParentsOutputFailed(proc.cleanedStdOut())));
return QStringList(); return QStringList();
} }
QStringList changeSets = lines.front().simplified().split(QLatin1Char(' ')); QStringList changeSets = lines.front().simplified().split(QLatin1Char(' '));
if (changeSets.size() < 2) { if (changeSets.size() < 2) {
VcsOutputWindow::appendSilently( VcsOutputWindow::appendSilently(
msgParentRevisionFailed(workingDirectory, revision, msgParseParentsOutputFailed(proc.stdOut()))); msgParentRevisionFailed(workingDirectory, revision, msgParseParentsOutputFailed(proc.cleanedStdOut())));
return QStringList(); return QStringList();
} }
// Remove revision numbers // Remove revision numbers
@@ -270,7 +270,7 @@ QString MercurialClient::shortDescriptionSync(const FilePath &workingDirectory,
vcsFullySynchronousExec(proc, workingDirectory, args); vcsFullySynchronousExec(proc, workingDirectory, args);
if (proc.result() != ProcessResult::FinishedWithSuccess) if (proc.result() != ProcessResult::FinishedWithSuccess)
return revision; return revision;
return stripLastNewline(proc.stdOut()); return stripLastNewline(proc.cleanedStdOut());
} }
// Default format: "SHA1 (author summmary)" // Default format: "SHA1 (author summmary)"
@@ -288,7 +288,7 @@ bool MercurialClient::managesFile(const FilePath &workingDirectory, const QStrin
args << QLatin1String("status") << QLatin1String("--unknown") << fileName; args << QLatin1String("status") << QLatin1String("--unknown") << fileName;
QtcProcess proc; QtcProcess proc;
vcsFullySynchronousExec(proc, workingDirectory, args); vcsFullySynchronousExec(proc, workingDirectory, args);
return proc.stdOut().isEmpty(); return proc.cleanedStdOut().isEmpty();
} }
void MercurialClient::incoming(const FilePath &repositoryRoot, const QString &repository) void MercurialClient::incoming(const FilePath &repositoryRoot, const QString &repository)

View File

@@ -66,7 +66,7 @@ Version ToolWrapper::read_version(const Utils::FilePath &toolPath)
process.setCommand({ toolPath, { "--version" } }); process.setCommand({ toolPath, { "--version" } });
process.start(); process.start();
if (process.waitForFinished()) if (process.waitForFinished())
return Version::fromString(process.stdOut()); return Version::fromString(process.cleanedStdOut());
} }
return {}; return {};
} }

View File

@@ -63,7 +63,7 @@ static std::vector<NimbleTask> parseTasks(const FilePath &nimblePath, const File
std::vector<NimbleTask> result; std::vector<NimbleTask> result;
if (process.exitCode() != 0) { if (process.exitCode() != 0) {
TaskHub::addTask(Task(Task::Error, process.stdOut(), {}, -1, Constants::C_NIMPARSE_ID)); TaskHub::addTask(Task(Task::Error, process.cleanedStdOut(), {}, -1, Constants::C_NIMPARSE_ID));
return result; return result;
} }
@@ -91,7 +91,7 @@ static NimbleMetadata parseMetadata(const FilePath &nimblePath, const FilePath &
NimbleMetadata result = {}; NimbleMetadata result = {};
if (process.exitCode() != 0) { if (process.exitCode() != 0) {
TaskHub::addTask(Task(Task::Error, process.stdOut(), {}, -1, Constants::C_NIMPARSE_ID)); TaskHub::addTask(Task(Task::Error, process.cleanedStdOut(), {}, -1, Constants::C_NIMPARSE_ID));
return result; return result;
} }
const QList<QByteArray> &lines = linesFromProcessOutput(&process); const QList<QByteArray> &lines = linesFromProcessOutput(&process);

View File

@@ -127,11 +127,11 @@ void PerforceChecker::slotDone()
break; break;
case QProcess::NormalExit: case QProcess::NormalExit:
if (m_process.exitCode()) { if (m_process.exitCode()) {
const QString stdErr = m_process.stdErr(); const QString stdErr = m_process.cleanedStdErr();
emitFailed(tr("\"%1\" terminated with exit code %2: %3"). emitFailed(tr("\"%1\" terminated with exit code %2: %3").
arg(m_binary.toUserOutput()).arg(m_process.exitCode()).arg(stdErr)); arg(m_binary.toUserOutput()).arg(m_process.exitCode()).arg(stdErr));
} else { } else {
parseOutput(m_process.stdOut()); parseOutput(m_process.cleanedStdOut());
} }
break; break;
} }

View File

@@ -1277,8 +1277,8 @@ PerforceResponse PerforcePluginPrivate::synchronousProcess(const FilePath &worki
PerforceResponse response; PerforceResponse response;
response.error = true; response.error = true;
response.exitCode = process.exitCode(); response.exitCode = process.exitCode();
response.stdErr = process.stdErr(); response.stdErr = process.cleanedStdErr();
response.stdOut = process.stdOut(); response.stdOut = process.cleanedStdOut();
switch (process.result()) { switch (process.result()) {
case ProcessResult::FinishedWithSuccess: case ProcessResult::FinishedWithSuccess:
response.error = false; response.error = false;

View File

@@ -118,7 +118,7 @@ static bool
process.runBlocking(EventLoopMode::On); process.runBlocking(EventLoopMode::On);
if (process.result() != Utils::ProcessResult::FinishedWithSuccess) { if (process.result() != Utils::ProcessResult::FinishedWithSuccess) {
*errorMessage = QString("Generator script failed: %1").arg(process.exitMessage()); *errorMessage = QString("Generator script failed: %1").arg(process.exitMessage());
const QString stdErr = process.stdErr(); const QString stdErr = process.cleanedStdErr();
if (!stdErr.isEmpty()) { if (!stdErr.isEmpty()) {
errorMessage->append(QLatin1Char('\n')); errorMessage->append(QLatin1Char('\n'));
errorMessage->append(stdErr); errorMessage->append(stdErr);
@@ -126,7 +126,7 @@ static bool
return false; return false;
} }
if (stdOut) { if (stdOut) {
*stdOut = process.stdOut(); *stdOut = process.cleanedStdOut();
if (CustomWizard::verbose()) if (CustomWizard::verbose())
qDebug("Output: '%s'\n", qPrintable(*stdOut)); qDebug("Output: '%s'\n", qPrintable(*stdOut));
} }

View File

@@ -68,12 +68,12 @@ void SshDeviceProcessList::doKillProcess(const ProcessInfo &process)
void SshDeviceProcessList::handleProcessDone() void SshDeviceProcessList::handleProcessDone()
{ {
if (d->m_process.result() == ProcessResult::FinishedWithSuccess) { if (d->m_process.result() == ProcessResult::FinishedWithSuccess) {
reportProcessListUpdated(buildProcessList(d->m_process.stdOut())); reportProcessListUpdated(buildProcessList(d->m_process.cleanedStdOut()));
} else { } else {
const QString errorMessage = d->m_process.exitStatus() == QProcess::NormalExit const QString errorMessage = d->m_process.exitStatus() == QProcess::NormalExit
? tr("Process listing command failed with exit code %1.").arg(d->m_process.exitCode()) ? tr("Process listing command failed with exit code %1.").arg(d->m_process.exitCode())
: d->m_process.errorString(); : d->m_process.errorString();
const QString stdErr = d->m_process.stdErr(); const QString stdErr = d->m_process.cleanedStdErr();
const QString fullMessage = stdErr.isEmpty() const QString fullMessage = stdErr.isEmpty()
? errorMessage : errorMessage + '\n' + tr("Remote stderr was: %1").arg(stdErr); ? errorMessage : errorMessage + '\n' + tr("Remote stderr was: %1").arg(stdErr);
reportError(fullMessage); reportError(fullMessage);

View File

@@ -1590,7 +1590,7 @@ bool ClangToolChain::matchesCompilerCommand(const Utils::FilePath &command,
std::unique_ptr<QtcProcess> xcrun(new QtcProcess); std::unique_ptr<QtcProcess> xcrun(new QtcProcess);
xcrun->setCommand({"/usr/bin/xcrun", {"-f", compilerCommand().fileName()}}); xcrun->setCommand({"/usr/bin/xcrun", {"-f", compilerCommand().fileName()}});
xcrun->runBlocking(); xcrun->runBlocking();
const FilePath output = FilePath::fromString(xcrun->stdOut().trimmed()); const FilePath output = FilePath::fromString(xcrun->cleanedStdOut().trimmed());
if (output.isExecutableFile() && output != compilerCommand()) if (output.isExecutableFile() && output != compilerCommand())
m_resolvedCompilerCommand = output; m_resolvedCompilerCommand = output;
} }

View File

@@ -296,7 +296,7 @@ static QVector<VisualStudioInstallation> detectVisualStudioFromVsWhere(const QSt
return installations; return installations;
} }
QByteArray output = vsWhereProcess.stdOut().toUtf8(); QByteArray output = vsWhereProcess.cleanedStdOut().toUtf8();
QJsonParseError error; QJsonParseError error;
const QJsonDocument doc = QJsonDocument::fromJson(output, &error); const QJsonDocument doc = QJsonDocument::fromJson(output, &error);
if (error.error != QJsonParseError::NoError || doc.isNull()) { if (error.error != QJsonParseError::NoError || doc.isNull()) {
@@ -667,7 +667,7 @@ Macros MsvcToolChain::msvcPredefinedMacros(const QStringList &cxxflags,
if (cpp.result() != ProcessResult::FinishedWithSuccess) if (cpp.result() != ProcessResult::FinishedWithSuccess)
return predefinedMacros; return predefinedMacros;
const QStringList output = Utils::filtered(cpp.stdOut().split('\n'), const QStringList output = Utils::filtered(cpp.cleanedStdOut().split('\n'),
[](const QString &s) { return s.startsWith('V'); }); [](const QString &s) { return s.startsWith('V'); });
for (const QString &line : output) for (const QString &line : output)
predefinedMacros.append(Macro::fromKeyValue(line.mid(1))); predefinedMacros.append(Macro::fromKeyValue(line.mid(1)));
@@ -1555,7 +1555,7 @@ static QVersionNumber clangClVersion(const FilePath &clangClPath)
return {}; return {};
const QRegularExpressionMatch match = QRegularExpression( const QRegularExpressionMatch match = QRegularExpression(
QStringLiteral("clang version (\\d+(\\.\\d+)+)")) QStringLiteral("clang version (\\d+(\\.\\d+)+)"))
.match(clangClProcess.stdOut()); .match(clangClProcess.cleanedStdOut());
if (!match.hasMatch()) if (!match.hasMatch())
return {}; return {};
return QVersionNumber::fromString(match.captured(1)); return QVersionNumber::fromString(match.captured(1));
@@ -2127,7 +2127,7 @@ Utils::optional<QString> MsvcToolChain::generateEnvironmentSettings(const Utils:
run.runBlocking(); run.runBlocking();
if (run.result() != ProcessResult::FinishedWithSuccess) { if (run.result() != ProcessResult::FinishedWithSuccess) {
const QString message = !run.stdErr().isEmpty() ? run.stdErr() : run.exitMessage(); const QString message = !run.cleanedStdErr().isEmpty() ? run.cleanedStdErr() : run.exitMessage();
qWarning().noquote() << message; qWarning().noquote() << message;
QString command = QDir::toNativeSeparators(batchFile); QString command = QDir::toNativeSeparators(batchFile);
if (!batchArgs.isEmpty()) if (!batchArgs.isEmpty())
@@ -2139,7 +2139,7 @@ Utils::optional<QString> MsvcToolChain::generateEnvironmentSettings(const Utils:
} }
// The SDK/MSVC scripts do not return exit codes != 0. Check on stdout. // The SDK/MSVC scripts do not return exit codes != 0. Check on stdout.
const QString stdOut = run.stdOut(); const QString stdOut = run.cleanedStdOut();
// //
// Now parse the file to get the environment settings // Now parse the file to get the environment settings

View File

@@ -78,7 +78,7 @@ static Interpreter createInterpreter(const FilePath &python,
pythonProcess.setCommand({python, {"--version"}}); pythonProcess.setCommand({python, {"--version"}});
pythonProcess.runBlocking(); pythonProcess.runBlocking();
if (pythonProcess.result() == ProcessResult::FinishedWithSuccess) if (pythonProcess.result() == ProcessResult::FinishedWithSuccess)
result.name = pythonProcess.stdOut().trimmed(); result.name = pythonProcess.cleanedStdOut().trimmed();
if (result.name.isEmpty()) if (result.name.isEmpty())
result.name = defaultName; result.name = defaultName;
if (windowedSuffix) if (windowedSuffix)

View File

@@ -125,7 +125,7 @@ EnvironmentItems QnxUtils::qnxEnvironmentFromEnvFile(const FilePath &filePath)
return items; return items;
// parsing process output // parsing process output
const QString output = process.stdOut(); const QString output = process.cleanedStdOut();
for (const QString &line : output.split('\n')) { for (const QString &line : output.split('\n')) {
int equalIndex = line.indexOf('='); int equalIndex = line.indexOf('=');
if (equalIndex < 0) if (equalIndex < 0)

View File

@@ -1822,7 +1822,7 @@ static QByteArray runQmakeQuery(const FilePath &binary, const Environment &env,
const QByteArray out = process.readAllStandardOutput(); const QByteArray out = process.readAllStandardOutput();
if (out.isEmpty()) { if (out.isEmpty()) {
*error = QCoreApplication::translate("QtVersion", "\"%1\" produced no output: %2.") *error = QCoreApplication::translate("QtVersion", "\"%1\" produced no output: %2.")
.arg(binary.displayName(), process.stdErr()); .arg(binary.displayName(), process.cleanedStdErr());
return {}; return {};
} }

View File

@@ -146,7 +146,7 @@ QDateTime GenericDirectUploadService::timestampFromStat(const DeployableFile &fi
error = tr("\"stat\" crashed."); error = tr("\"stat\" crashed.");
} else if (statProc->exitCode() != 0) { } else if (statProc->exitCode() != 0) {
error = tr("\"stat\" failed with exit code %1: %2") error = tr("\"stat\" failed with exit code %1: %2")
.arg(statProc->exitCode()).arg(statProc->stdErr()); .arg(statProc->exitCode()).arg(statProc->cleanedStdErr());
} else { } else {
succeeded = true; succeeded = true;
} }

View File

@@ -260,7 +260,7 @@ QString SshSharedConnection::fullProcessError() const
{ {
const QString errorString = m_masterProcess->exitStatus() == QProcess::CrashExit const QString errorString = m_masterProcess->exitStatus() == QProcess::CrashExit
? m_masterProcess->errorString() : QString(); ? m_masterProcess->errorString() : QString();
const QString standardError = m_masterProcess->stdErr(); const QString standardError = m_masterProcess->cleanedStdErr();
const QString errorPrefix = errorString.isEmpty() && standardError.isEmpty() const QString errorPrefix = errorString.isEmpty() && standardError.isEmpty()
? tr("SSH connection failure.") : tr("SSH connection failure:"); ? tr("SSH connection failure.") : tr("SSH connection failure:");
QStringList allErrors {errorPrefix, errorString, standardError}; QStringList allErrors {errorPrefix, errorString, standardError};

View File

@@ -183,7 +183,7 @@ void GenericLinuxDeviceTester::handleEchoDone()
return; return;
} }
const QString reply = d->echoProcess.stdOut().chopped(1); // Remove trailing \n const QString reply = d->echoProcess.cleanedStdOut().chopped(1); // Remove trailing \n
if (reply != s_echoContents) if (reply != s_echoContents)
emit errorMessage(tr("Device replied to echo with unexpected contents.") + '\n'); emit errorMessage(tr("Device replied to echo with unexpected contents.") + '\n');
else else

View File

@@ -80,7 +80,7 @@ PublicKeyDeploymentDialog::PublicKeyDeploymentDialog(const IDevice::ConstPtr &de
if (!succeeded) { if (!succeeded) {
QString errorMessage = d->m_process.errorString(); QString errorMessage = d->m_process.errorString();
if (errorMessage.isEmpty()) if (errorMessage.isEmpty())
errorMessage = d->m_process.stdErr(); errorMessage = d->m_process.cleanedStdErr();
if (errorMessage.endsWith('\n')) if (errorMessage.endsWith('\n'))
errorMessage.chop(1); errorMessage.chop(1);
finalMessage = tr("Key deployment failed."); finalMessage = tr("Key deployment failed.");

View File

@@ -52,7 +52,7 @@ public:
connect(&m_mkdir, &QtcProcess::done, this, [this] { connect(&m_mkdir, &QtcProcess::done, this, [this] {
if (m_mkdir.result() != ProcessResult::FinishedWithSuccess) { if (m_mkdir.result() != ProcessResult::FinishedWithSuccess) {
QString finalMessage = m_mkdir.errorString(); QString finalMessage = m_mkdir.errorString();
const QString stdErr = m_mkdir.stdErr(); const QString stdErr = m_mkdir.cleanedStdErr();
if (!stdErr.isEmpty()) { if (!stdErr.isEmpty()) {
if (!finalMessage.isEmpty()) if (!finalMessage.isEmpty())
finalMessage += '\n'; finalMessage += '\n';

View File

@@ -90,7 +90,7 @@ bool isSilverSearcherAvailable()
silverSearcherProcess.setCommand({"ag", {"--version"}}); silverSearcherProcess.setCommand({"ag", {"--version"}});
silverSearcherProcess.start(); silverSearcherProcess.start();
if (silverSearcherProcess.waitForFinished(1000)) { if (silverSearcherProcess.waitForFinished(1000)) {
if (silverSearcherProcess.stdOut().contains("ag version")) if (silverSearcherProcess.cleanedStdOut().contains("ag version"))
return true; return true;
} }
@@ -145,7 +145,7 @@ void runSilverSeacher(FutureInterfaceType &fi, FileFindParameters parameters)
regexp.setPattern(parameters.text); regexp.setPattern(parameters.text);
regexp.setPatternOptions(patternOptions); regexp.setPatternOptions(patternOptions);
} }
SilverSearcher::SilverSearcherOutputParser parser(process.stdOut(), regexp); SilverSearcher::SilverSearcherOutputParser parser(process.cleanedStdOut(), regexp);
FileSearchResultList items = parser.parse(); FileSearchResultList items = parser.parse();
if (!items.isEmpty()) if (!items.isEmpty())
fi.reportResult(items); fi.reportResult(items);

View File

@@ -157,7 +157,7 @@ QString SubversionClient::synchronousTopic(const FilePath &repository) const
if (proc.result() != ProcessResult::FinishedWithSuccess) if (proc.result() != ProcessResult::FinishedWithSuccess)
return QString(); return QString();
return proc.stdOut().trimmed(); return proc.cleanedStdOut().trimmed();
} }
QString SubversionClient::escapeFile(const QString &file) QString SubversionClient::escapeFile(const QString &file)

View File

@@ -1034,8 +1034,8 @@ SubversionResponse SubversionPluginPrivate::runSvn(const FilePath &workingDir,
response.error = proc.result() != ProcessResult::FinishedWithSuccess; response.error = proc.result() != ProcessResult::FinishedWithSuccess;
if (response.error) if (response.error)
response.message = proc.exitMessage(); response.message = proc.exitMessage();
response.stdErr = proc.stdErr(); response.stdErr = proc.cleanedStdErr();
response.stdOut = proc.stdOut(); response.stdOut = proc.cleanedStdOut();
return response; return response;
} }

View File

@@ -97,7 +97,7 @@ static FormatTask format(FormatTask task)
.arg(process.exitMessage()); .arg(process.exitMessage());
return task; return task;
} }
const QString output = process.stdErr(); const QString output = process.cleanedStdErr();
if (!output.isEmpty()) if (!output.isEmpty())
task.error = executable + QLatin1String(": ") + output; task.error = executable + QLatin1String(": ") + output;

View File

@@ -71,7 +71,7 @@ FilePath findFallbackDefinitionsLocation()
process.setCommand({program, {"--prefix"}}); process.setCommand({program, {"--prefix"}});
process.runBlocking(); process.runBlocking();
if (process.result() == ProcessResult::FinishedWithSuccess) { if (process.result() == ProcessResult::FinishedWithSuccess) {
QString output = process.stdOut(); QString output = process.cleanedStdOut();
output.remove('\n'); output.remove('\n');
const FilePath dir = FilePath::fromString(output); const FilePath dir = FilePath::fromString(output);
for (auto &kateSyntaxPath : kateSyntaxPaths) { for (auto &kateSyntaxPath : kateSyntaxPaths) {

View File

@@ -167,7 +167,7 @@ void UpdateInfoPlugin::startCheckForUpdates()
this, this,
[this, futureIf]() mutable { [this, futureIf]() mutable {
if (d->m_maintenanceToolProcess->result() == ProcessResult::FinishedWithSuccess) { if (d->m_maintenanceToolProcess->result() == ProcessResult::FinishedWithSuccess) {
d->m_updateOutput = d->m_maintenanceToolProcess->stdOut(); d->m_updateOutput = d->m_maintenanceToolProcess->cleanedStdOut();
if (d->m_settings.checkForQtVersions) { if (d->m_settings.checkForQtVersions) {
d->m_maintenanceToolProcess.reset(new QtcProcess); d->m_maintenanceToolProcess.reset(new QtcProcess);
d->m_maintenanceToolProcess->setCommand( d->m_maintenanceToolProcess->setCommand(
@@ -181,7 +181,7 @@ void UpdateInfoPlugin::startCheckForUpdates()
[this, futureIf]() mutable { [this, futureIf]() mutable {
if (d->m_maintenanceToolProcess->result() if (d->m_maintenanceToolProcess->result()
== ProcessResult::FinishedWithSuccess) { == ProcessResult::FinishedWithSuccess) {
d->m_packagesOutput = d->m_maintenanceToolProcess->stdOut(); d->m_packagesOutput = d->m_maintenanceToolProcess->cleanedStdOut();
d->m_maintenanceToolProcess.reset(); d->m_maintenanceToolProcess.reset();
futureIf.reportFinished(); futureIf.reportFinished();
checkForUpdatesFinished(); checkForUpdatesFinished();

View File

@@ -211,7 +211,7 @@ void ValgrindRunner::Private::findPidProcessDone()
emit q->processOutputReceived(m_findPID.allOutput(), StdErrFormat); emit q->processOutputReceived(m_findPID.allOutput(), StdErrFormat);
return; return;
} }
QString out = m_findPID.stdOut(); QString out = m_findPID.cleanedStdOut();
if (out.isEmpty()) if (out.isEmpty())
return; return;
bool ok; bool ok;

View File

@@ -277,7 +277,7 @@ bool VcsBaseClient::synchronousCreateRepository(const FilePath &workingDirectory
vcsFullySynchronousExec(proc, workingDirectory, args); vcsFullySynchronousExec(proc, workingDirectory, args);
if (proc.result() != ProcessResult::FinishedWithSuccess) if (proc.result() != ProcessResult::FinishedWithSuccess)
return false; return false;
VcsOutputWindow::append(proc.stdOut()); VcsOutputWindow::append(proc.cleanedStdOut());
resetCachedVcsInfo(workingDirectory); resetCachedVcsInfo(workingDirectory);

View File

@@ -118,7 +118,7 @@ QVersionNumber WebAssemblyEmSdk::version(const FilePath &sdkRoot)
emcc.setCommand(command); emcc.setCommand(command);
emcc.setEnvironment(env); emcc.setEnvironment(env);
emcc.runBlocking(); emcc.runBlocking();
const QString version = emcc.stdOut(); const QString version = emcc.cleanedStdOut();
emSdkVersionCache()->insert(cacheKey, emSdkVersionCache()->insert(cacheKey,
new QVersionNumber(QVersionNumber::fromString(version))); new QVersionNumber(QVersionNumber::fromString(version)));
} }