forked from qt-creator/qt-creator
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:
@@ -50,7 +50,7 @@ FilePath BuildableHelperLibrary::qtChooserToQmakePath(const FilePath &qtChooser)
|
||||
proc.runBlocking();
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess)
|
||||
return {};
|
||||
const QString output = proc.stdOut();
|
||||
const QString output = proc.cleanedStdOut();
|
||||
int pos = output.indexOf(toolDir);
|
||||
if (pos == -1)
|
||||
return {};
|
||||
|
@@ -1051,17 +1051,17 @@ QtcProcess::QtcProcess(QObject *parent)
|
||||
qCDebug(processLog).nospace() << "Process " << number << " finished: "
|
||||
<< "result=" << int(result())
|
||||
<< ", ex=" << exitCode()
|
||||
<< ", " << stdOut().size() << " bytes stdout: "
|
||||
<< stdOut().left(20)
|
||||
<< ", " << stdErr().size() << " bytes stderr: "
|
||||
<< stdErr().left(1000)
|
||||
<< ", " << cleanedStdOut().size() << " bytes stdout: "
|
||||
<< cleanedStdOut().left(20)
|
||||
<< ", " << cleanedStdErr().size() << " bytes stderr: "
|
||||
<< cleanedStdErr().left(1000)
|
||||
<< ", " << msElapsed << " ms elapsed";
|
||||
if (processStdoutLog().isDebugEnabled() && !stdOut().isEmpty())
|
||||
if (processStdoutLog().isDebugEnabled() && !cleanedStdOut().isEmpty())
|
||||
qCDebug(processStdoutLog).nospace()
|
||||
<< "Process " << number << " sdout: " << stdOut();
|
||||
if (processStderrLog().isDebugEnabled() && !stdErr().isEmpty())
|
||||
<< "Process " << number << " sdout: " << cleanedStdOut();
|
||||
if (processStderrLog().isDebugEnabled() && !cleanedStdErr().isEmpty())
|
||||
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_stdErr.keepRawData);
|
||||
const QString out = stdOut();
|
||||
const QString err = stdErr();
|
||||
const QString out = cleanedStdOut();
|
||||
const QString err = cleanedStdErr();
|
||||
|
||||
if (!out.isEmpty() && !err.isEmpty()) {
|
||||
QString result = out;
|
||||
@@ -1748,12 +1748,12 @@ static QStringList splitLines(const QString &text)
|
||||
|
||||
const QStringList QtcProcess::stdOutLines() const
|
||||
{
|
||||
return splitLines(stdOut());
|
||||
return splitLines(cleanedStdOut());
|
||||
}
|
||||
|
||||
const QStringList QtcProcess::stdErrLines() const
|
||||
{
|
||||
return splitLines(stdErr());
|
||||
return splitLines(cleanedStdErr());
|
||||
}
|
||||
|
||||
QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug str, const QtcProcess &r)
|
||||
|
@@ -271,8 +271,8 @@ void ShellCommand::run(QFutureInterface<void> &future)
|
||||
proc.setExitCodeInterpreter(job.exitCodeInterpreter);
|
||||
proc.setTimeoutS(job.timeoutS);
|
||||
runCommand(proc, job.command, job.workingDirectory);
|
||||
stdOut += proc.stdOut();
|
||||
stdErr += proc.stdErr();
|
||||
stdOut += proc.cleanedStdOut();
|
||||
stdErr += proc.cleanedStdErr();
|
||||
d->m_lastExecExitCode = proc.exitCode();
|
||||
d->m_lastExecSuccess = proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
if (!d->m_lastExecSuccess)
|
||||
@@ -352,11 +352,11 @@ void ShellCommand::runFullySynchronous(QtcProcess &process, const FilePath &work
|
||||
process.runBlocking();
|
||||
|
||||
if (!d->m_aborted) {
|
||||
const QString stdErr = process.stdErr();
|
||||
const QString stdErr = process.cleanedStdErr();
|
||||
if (!stdErr.isEmpty() && !(d->m_flags & SuppressStdErr))
|
||||
emit append(stdErr);
|
||||
|
||||
const QString stdOut = process.stdOut();
|
||||
const QString stdOut = process.cleanedStdOut();
|
||||
if (!stdOut.isEmpty() && d->m_flags & ShowStdOut) {
|
||||
if (d->m_flags & SilentOutput)
|
||||
emit appendSilently(stdOut);
|
||||
|
@@ -1065,7 +1065,7 @@ QAbstractItemModel *AndroidBuildApkStep::keystoreCertificates()
|
||||
if (keytoolProc.result() > ProcessResult::FinishedWithError)
|
||||
QMessageBox::critical(nullptr, tr("Error"), tr("Failed to run keytool."));
|
||||
else
|
||||
model = new CertificatesModel(keytoolProc.stdOut(), this);
|
||||
model = new CertificatesModel(keytoolProc.cleanedStdOut(), this);
|
||||
|
||||
return model;
|
||||
}
|
||||
|
@@ -787,8 +787,8 @@ SdkToolResult AndroidManager::runCommand(const CommandLine &command,
|
||||
qCDebug(androidManagerLog) << "Running command (sync):" << command.toUserOutput();
|
||||
cmdProc.setCommand(command);
|
||||
cmdProc.runBlocking(EventLoopMode::On);
|
||||
cmdResult.m_stdOut = cmdProc.stdOut().trimmed();
|
||||
cmdResult.m_stdErr = cmdProc.stdErr().trimmed();
|
||||
cmdResult.m_stdOut = cmdProc.cleanedStdOut().trimmed();
|
||||
cmdResult.m_stdErr = cmdProc.cleanedStdErr().trimmed();
|
||||
cmdResult.m_success = cmdProc.result() == ProcessResult::FinishedWithSuccess;
|
||||
qCDebug(androidManagerLog) << "Command finshed (sync):" << command.toUserOutput()
|
||||
<< "Success:" << cmdResult.m_success
|
||||
|
@@ -186,7 +186,7 @@ static void sdkManagerCommand(const AndroidConfig &config, const QStringList &ar
|
||||
proc.runBlocking(EventLoopMode::On);
|
||||
if (assertionFound) {
|
||||
output.success = false;
|
||||
output.stdOutput = proc.stdOut();
|
||||
output.stdOutput = proc.cleanedStdOut();
|
||||
output.stdError = QCoreApplication::translate("Android::Internal::AndroidSdkManager",
|
||||
"The operation requires user interaction. "
|
||||
"Use the \"sdkmanager\" command-line tool.");
|
||||
|
@@ -153,7 +153,7 @@ bool BazaarClient::synchronousUncommit(const FilePath &workingDir,
|
||||
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDir, args);
|
||||
VcsOutputWindow::append(proc.stdOut());
|
||||
VcsOutputWindow::append(proc.cleanedStdOut());
|
||||
return proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
|
@@ -92,10 +92,10 @@ static int updateVersionHelper(const FilePath &command)
|
||||
return 0;
|
||||
|
||||
// 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)
|
||||
return version;
|
||||
return parseVersion(process.stdErr().trimmed());
|
||||
return parseVersion(process.cleanedStdErr().trimmed());
|
||||
}
|
||||
|
||||
void ArtisticStyleSettings::updateVersion()
|
||||
@@ -204,7 +204,7 @@ void ArtisticStyleSettings::createDocumentationFile() const
|
||||
stream.writeStartElement(Constants::DOCUMENTATION_XMLROOT);
|
||||
|
||||
// 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 docu;
|
||||
for (QString line : lines) {
|
||||
|
@@ -88,8 +88,8 @@ public:
|
||||
private:
|
||||
void handleDone()
|
||||
{
|
||||
const QString stdOut = m_appRunner.stdOut();
|
||||
const QString stdErr = m_appRunner.stdErr();
|
||||
const QString stdOut = m_appRunner.cleanedStdOut();
|
||||
const QString stdErr = m_appRunner.cleanedStdErr();
|
||||
|
||||
// FIXME: Needed in a post-adb world?
|
||||
// adb does not forward exit codes and all stderr goes to stdout.
|
||||
|
@@ -132,7 +132,7 @@ void ClangToolRunner::onProcessDone()
|
||||
if (m_process.result() == ProcessResult::StartFailed) {
|
||||
emit finishedWithFailure(generalProcessError(m_name), commandlineAndOutput());
|
||||
} 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);
|
||||
} else if (m_process.result() == ProcessResult::FinishedWithError) {
|
||||
emit finishedWithFailure(finishedWithBadExitCode(m_name, m_process.exitCode()),
|
||||
@@ -149,7 +149,7 @@ QString ClangToolRunner::commandlineAndOutput() const
|
||||
"Output:\n%3")
|
||||
.arg(m_commandLine.toUserOutput())
|
||||
.arg(m_process.error())
|
||||
.arg(m_process.stdOut());
|
||||
.arg(m_process.cleanedStdOut());
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -63,7 +63,7 @@ static QString runExecutable(const Utils::CommandLine &commandLine, QueryFailMod
|
||||
return {};
|
||||
}
|
||||
|
||||
return cpp.stdOut();
|
||||
return cpp.cleanedStdOut();
|
||||
}
|
||||
|
||||
static QStringList queryClangTidyChecks(const FilePath &executable,
|
||||
|
@@ -1676,8 +1676,8 @@ ClearCasePluginPrivate::runCleartool(const FilePath &workingDir,
|
||||
response.error = proc.result() != ProcessResult::FinishedWithSuccess;
|
||||
if (response.error)
|
||||
response.message = proc.exitMessage();
|
||||
response.stdErr = proc.stdErr();
|
||||
response.stdOut = proc.stdOut();
|
||||
response.stdErr = proc.cleanedStdErr();
|
||||
response.stdOut = proc.cleanedStdOut();
|
||||
return response;
|
||||
}
|
||||
|
||||
|
@@ -280,19 +280,19 @@ TextEditor::Keywords CMakeTool::keywords()
|
||||
QtcProcess proc;
|
||||
runCMake(proc, {"--help-command-list"}, 5);
|
||||
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);
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess)
|
||||
parseFunctionDetailsOutput(proc.stdOut());
|
||||
parseFunctionDetailsOutput(proc.cleanedStdOut());
|
||||
|
||||
runCMake(proc, {"--help-property-list"}, 5);
|
||||
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);
|
||||
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);
|
||||
Utils::sort(m_introspection->m_variables);
|
||||
}
|
||||
@@ -523,7 +523,7 @@ void CMakeTool::fetchFromCapabilities() const
|
||||
|
||||
if (cmake.result() == ProcessResult::FinishedWithSuccess) {
|
||||
m_introspection->m_didRun = true;
|
||||
parseFromCapabilities(cmake.stdOut());
|
||||
parseFromCapabilities(cmake.cleanedStdOut());
|
||||
} else {
|
||||
qCCritical(cmakeToolLog) << "Fetching capabilities failed: " << cmake.allOutput() << cmake.error();
|
||||
m_introspection->m_didRun = false;
|
||||
|
@@ -1449,8 +1449,8 @@ CvsResponse CvsPluginPrivate::runCvs(const FilePath &workingDirectory,
|
||||
command.runCommand(proc, {executable, m_settings.addOptions(arguments)});
|
||||
|
||||
response.result = CvsResponse::OtherError;
|
||||
response.stdErr = proc.stdErr();
|
||||
response.stdOut = proc.stdOut();
|
||||
response.stdErr = proc.cleanedStdErr();
|
||||
response.stdOut = proc.cleanedStdOut();
|
||||
switch (proc.result()) {
|
||||
case ProcessResult::FinishedWithSuccess:
|
||||
response.result = CvsResponse::Ok;
|
||||
|
@@ -5004,7 +5004,7 @@ CoreInfo CoreInfo::readExecutableNameFromCore(const Runnable &debugger, const Fi
|
||||
proc.runBlocking();
|
||||
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess) {
|
||||
QString output = proc.stdOut();
|
||||
QString output = proc.cleanedStdOut();
|
||||
// Core was generated by `/data/dev/creator-2.6/bin/qtcreator'.
|
||||
// Program terminated with signal 11, Segmentation fault.
|
||||
int pos1 = output.indexOf("Core was generated by");
|
||||
|
@@ -444,7 +444,7 @@ void DockerDevicePrivate::startContainer()
|
||||
if (createProcess.result() != ProcessResult::FinishedWithSuccess)
|
||||
return;
|
||||
|
||||
m_container = createProcess.stdOut().trimmed();
|
||||
m_container = createProcess.cleanedStdOut().trimmed();
|
||||
if (m_container.isEmpty())
|
||||
return;
|
||||
LOG("Container via process: " << m_container);
|
||||
@@ -988,11 +988,11 @@ void DockerDevicePrivate::fetchSystemEnviroment()
|
||||
proc.setCommand(q->withDockerExecCmd({"env", {}}));
|
||||
proc.start();
|
||||
proc.waitForFinished();
|
||||
const QString remoteOutput = proc.stdOut();
|
||||
const QString remoteOutput = proc.cleanedStdOut();
|
||||
|
||||
m_cachedEnviroment = Environment(remoteOutput.split('\n', Qt::SkipEmptyParts), q->osType());
|
||||
|
||||
const QString remoteError = proc.stdErr();
|
||||
const QString remoteError = proc.cleanedStdErr();
|
||||
if (!remoteError.isEmpty())
|
||||
qWarning("Cannot read container environment: %s\n", qPrintable(remoteError));
|
||||
}
|
||||
@@ -1126,7 +1126,7 @@ public:
|
||||
});
|
||||
|
||||
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));
|
||||
});
|
||||
|
||||
|
@@ -162,7 +162,7 @@ void ChangeSelectionDialog::setDetails()
|
||||
|
||||
QPalette palette;
|
||||
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));
|
||||
m_ui->changeNumberEdit->setPalette(palette);
|
||||
} else {
|
||||
|
@@ -247,7 +247,7 @@ int GerritServer::testConnection()
|
||||
client->vcsFullySynchronousExec(proc, {}, {curlBinary, arguments},
|
||||
Core::ShellCommand::NoOutput);
|
||||
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
|
||||
// so consider this as 404.
|
||||
if (output.isEmpty())
|
||||
@@ -266,7 +266,7 @@ int GerritServer::testConnection()
|
||||
if (proc.exitCode() == CertificateError)
|
||||
return CertificateError;
|
||||
const QRegularExpression errorRegexp("returned error: (\\d+)");
|
||||
QRegularExpressionMatch match = errorRegexp.match(proc.stdErr());
|
||||
QRegularExpressionMatch match = errorRegexp.match(proc.cleanedStdErr());
|
||||
if (match.hasMatch())
|
||||
return match.captured(1).toInt();
|
||||
return UnknownError;
|
||||
@@ -346,7 +346,7 @@ bool GerritServer::resolveVersion(const GerritParameters &p, bool forceReload)
|
||||
arguments << p.portFlag << QString::number(port);
|
||||
arguments << hostArgument() << "gerrit" << "version";
|
||||
client->vcsFullySynchronousExec(proc, {}, {p.ssh, arguments}, Core::ShellCommand::NoOutput);
|
||||
QString stdOut = proc.stdOut().trimmed();
|
||||
QString stdOut = proc.cleanedStdOut().trimmed();
|
||||
stdOut.remove("gerrit version ");
|
||||
version = stdOut;
|
||||
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
|
||||
// if it fails.
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess) {
|
||||
QString output = proc.stdOut();
|
||||
QString output = proc.cleanedStdOut();
|
||||
if (output.isEmpty())
|
||||
return false;
|
||||
output.remove(0, output.indexOf('\n')); // Strip first line
|
||||
|
@@ -761,8 +761,8 @@ public:
|
||||
// No conflicts => do nothing
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess)
|
||||
return;
|
||||
handler.readStdOut(proc.stdOut());
|
||||
handler.readStdErr(proc.stdErr());
|
||||
handler.readStdOut(proc.cleanedStdOut());
|
||||
handler.readStdErr(proc.cleanedStdErr());
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -944,7 +944,7 @@ FilePaths GitClient::unmanagedFiles(const FilePaths &filePaths) const
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess)
|
||||
return filePaths;
|
||||
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); });
|
||||
const QStringList filtered = Utils::filtered(it.value(), [&managedFilePaths, &wd](const QString &fp) {
|
||||
return !managedFilePaths.contains(wd.absoluteFilePath(fp));
|
||||
@@ -1515,7 +1515,7 @@ void GitClient::recoverDeletedFiles(const FilePath &workingDirectory)
|
||||
vcsFullySynchronousExec(proc, workingDirectory, {"ls-files", "--deleted"},
|
||||
VcsCommand::SuppressCommandLogging);
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess) {
|
||||
const QString stdOut = proc.stdOut().trimmed();
|
||||
const QString stdOut = proc.cleanedStdOut().trimmed();
|
||||
if (stdOut.isEmpty()) {
|
||||
VcsOutputWindow::appendError(tr("Nothing to recover"));
|
||||
return;
|
||||
@@ -1542,11 +1542,11 @@ bool GitClient::synchronousLog(const FilePath &workingDirectory, const QStringLi
|
||||
vcsFullySynchronousExec(proc, workingDirectory, allArguments, flags, vcsTimeoutS(),
|
||||
encoding(workingDirectory, "i18n.logOutputEncoding"));
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess) {
|
||||
*output = proc.stdOut();
|
||||
*output = proc.cleanedStdOut();
|
||||
return true;
|
||||
} else {
|
||||
msgCannotRun(tr("Cannot obtain log of \"%1\": %2")
|
||||
.arg(workingDirectory.toUserOutput(), proc.stdErr()), errorMessageIn);
|
||||
.arg(workingDirectory.toUserOutput(), proc.cleanedStdErr()), errorMessageIn);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1596,7 +1596,7 @@ bool GitClient::synchronousReset(const FilePath &workingDirectory,
|
||||
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments);
|
||||
const QString stdOut = proc.stdOut();
|
||||
const QString stdOut = proc.cleanedStdOut();
|
||||
VcsOutputWindow::append(stdOut);
|
||||
// Note that git exits with 1 even if the operation is successful
|
||||
// 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
|
||||
&& (!stdOut.contains("modified") && !stdOut.contains("Unstaged changes after reset"))) {
|
||||
if (files.isEmpty()) {
|
||||
msgCannotRun(arguments, workingDirectory, proc.stdErr(), errorMessage);
|
||||
msgCannotRun(arguments, workingDirectory, proc.cleanedStdErr(), errorMessage);
|
||||
} else {
|
||||
msgCannotRun(tr("Cannot reset %n files in \"%1\": %2", nullptr, files.size())
|
||||
.arg(workingDirectory.toUserOutput(), proc.stdErr()),
|
||||
.arg(workingDirectory.toUserOutput(), proc.cleanedStdErr()),
|
||||
errorMessage);
|
||||
}
|
||||
return false;
|
||||
@@ -1621,7 +1621,7 @@ bool GitClient::synchronousInit(const FilePath &workingDirectory)
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, QStringList{"init"});
|
||||
// '[Re]Initialized...'
|
||||
VcsOutputWindow::append(proc.stdOut());
|
||||
VcsOutputWindow::append(proc.cleanedStdOut());
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess) {
|
||||
resetCachedVcsInfo(workingDirectory);
|
||||
return true;
|
||||
@@ -1653,7 +1653,7 @@ bool GitClient::synchronousCheckoutFiles(const FilePath &workingDirectory, QStri
|
||||
//: Meaning of the arguments: %1: revision, %2: files, %3: repository,
|
||||
//: %4: Error message
|
||||
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);
|
||||
return false;
|
||||
}
|
||||
@@ -1701,10 +1701,10 @@ bool GitClient::synchronousRevListCmd(const FilePath &workingDirectory, const QS
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags);
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
msgCannotRun(arguments, workingDirectory, proc.stdErr(), errorMessage);
|
||||
msgCannotRun(arguments, workingDirectory, proc.cleanedStdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
*output = proc.stdOut();
|
||||
*output = proc.cleanedStdOut();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1765,7 +1765,7 @@ QString GitClient::synchronousCurrentLocalBranch(const FilePath &workingDirector
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, {"symbolic-ref", HEAD}, silentFlags);
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess) {
|
||||
branch = proc.stdOut().trimmed();
|
||||
branch = proc.cleanedStdOut().trimmed();
|
||||
} else {
|
||||
const QString gitDir = findGitDirForRepository(workingDirectory);
|
||||
const QString rebaseHead = gitDir + "/rebase-merge/head-name";
|
||||
@@ -1790,11 +1790,11 @@ bool GitClient::synchronousHeadRefs(const FilePath &workingDirectory, QStringLis
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags);
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
msgCannotRun(arguments, workingDirectory, proc.stdErr(), errorMessage);
|
||||
msgCannotRun(arguments, workingDirectory, proc.cleanedStdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
|
||||
const QString stdOut = proc.stdOut();
|
||||
const QString stdOut = proc.cleanedStdOut();
|
||||
const QString headSha = stdOut.left(10);
|
||||
QString rest = stdOut.mid(15);
|
||||
|
||||
@@ -1839,7 +1839,7 @@ QString GitClient::synchronousTopic(const FilePath &workingDirectory) const
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, QStringList{"describe"}, VcsCommand::NoOutput);
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess) {
|
||||
const QString stdOut = proc.stdOut().trimmed();
|
||||
const QString stdOut = proc.cleanedStdOut().trimmed();
|
||||
if (!stdOut.isEmpty())
|
||||
return stdOut;
|
||||
}
|
||||
@@ -1852,9 +1852,9 @@ bool GitClient::synchronousRevParseCmd(const FilePath &workingDirectory, const Q
|
||||
const QStringList arguments = {"rev-parse", ref};
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags);
|
||||
*output = proc.stdOut().trimmed();
|
||||
*output = proc.cleanedStdOut().trimmed();
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
msgCannotRun(arguments, workingDirectory, proc.stdErr(), errorMessage);
|
||||
msgCannotRun(arguments, workingDirectory, proc.cleanedStdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1869,7 +1869,7 @@ QString GitClient::synchronousTopRevision(const FilePath &workingDirectory, QDat
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags);
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess)
|
||||
return QString();
|
||||
const QStringList output = proc.stdOut().trimmed().split(':');
|
||||
const QStringList output = proc.cleanedStdOut().trimmed().split(':');
|
||||
if (dateTime && output.size() > 1) {
|
||||
bool ok = false;
|
||||
const qint64 timeT = output.at(1).toLongLong(&ok);
|
||||
@@ -1889,7 +1889,7 @@ bool GitClient::isFastForwardMerge(const FilePath &workingDirectory, const QStri
|
||||
{
|
||||
QtcProcess proc;
|
||||
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.
|
||||
@@ -1902,10 +1902,10 @@ QString GitClient::synchronousShortDescription(const FilePath &workingDirectory,
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags);
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
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 stripLastNewline(proc.stdOut());
|
||||
return stripLastNewline(proc.cleanedStdOut());
|
||||
}
|
||||
|
||||
// Create a default message to be used for describing stashes
|
||||
@@ -1982,7 +1982,7 @@ bool GitClient::executeSynchronousStash(const FilePath &workingDirectory,
|
||||
QtcProcess proc;
|
||||
vcsSynchronousExec(proc, workingDirectory, arguments, flags);
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
msgCannotRun(arguments, workingDirectory, proc.stdErr(), errorMessage);
|
||||
msgCannotRun(arguments, workingDirectory, proc.cleanedStdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2021,9 +2021,9 @@ bool GitClient::synchronousBranchCmd(const FilePath &workingDirectory, QStringLi
|
||||
branchArgs.push_front("branch");
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, branchArgs);
|
||||
*output = proc.stdOut();
|
||||
*output = proc.cleanedStdOut();
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
msgCannotRun(branchArgs, workingDirectory, proc.stdErr(), errorMessage);
|
||||
msgCannotRun(branchArgs, workingDirectory, proc.cleanedStdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -2035,9 +2035,9 @@ bool GitClient::synchronousTagCmd(const FilePath &workingDirectory, QStringList
|
||||
tagArgs.push_front("tag");
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, tagArgs);
|
||||
*output = proc.stdOut();
|
||||
*output = proc.cleanedStdOut();
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
msgCannotRun(tagArgs, workingDirectory, proc.stdErr(), errorMessage);
|
||||
msgCannotRun(tagArgs, workingDirectory, proc.cleanedStdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -2049,9 +2049,9 @@ bool GitClient::synchronousForEachRefCmd(const FilePath &workingDirectory, QStri
|
||||
args.push_front("for-each-ref");
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, args, silentFlags);
|
||||
*output = proc.stdOut();
|
||||
*output = proc.cleanedStdOut();
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
msgCannotRun(args, workingDirectory, proc.stdErr(), errorMessage);
|
||||
msgCannotRun(args, workingDirectory, proc.cleanedStdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -2070,9 +2070,9 @@ bool GitClient::synchronousRemoteCmd(const FilePath &workingDirectory, QStringLi
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, remoteArgs, silent ? silentFlags : 0);
|
||||
|
||||
const QString stdErr = proc.stdErr();
|
||||
const QString stdErr = proc.cleanedStdErr();
|
||||
*errorMessage = stdErr;
|
||||
*output = proc.stdOut();
|
||||
*output = proc.cleanedStdOut();
|
||||
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
msgCannotRun(remoteArgs, workingDirectory, stdErr, errorMessage);
|
||||
@@ -2116,10 +2116,10 @@ QStringList GitClient::synchronousSubmoduleStatus(const FilePath &workingDirecto
|
||||
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
msgCannotRun(tr("Cannot retrieve submodule status of \"%1\": %2")
|
||||
.arg(workingDirectory.toUserOutput(), proc.stdErr()), errorMessage);
|
||||
.arg(workingDirectory.toUserOutput(), proc.cleanedStdErr()), errorMessage);
|
||||
return QStringList();
|
||||
}
|
||||
return splitLines(proc.stdOut());
|
||||
return splitLines(proc.cleanedStdOut());
|
||||
}
|
||||
|
||||
SubmoduleDataMap GitClient::submoduleList(const FilePath &workingDirectory) const
|
||||
@@ -2195,7 +2195,7 @@ QByteArray GitClient::synchronousShow(const FilePath &workingDirectory, const QS
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, flags);
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
msgCannotRun(arguments, workingDirectory, proc.stdErr(), nullptr);
|
||||
msgCannotRun(arguments, workingDirectory, proc.cleanedStdErr(), nullptr);
|
||||
return {};
|
||||
}
|
||||
return proc.rawStdOut();
|
||||
@@ -2211,7 +2211,7 @@ bool GitClient::cleanList(const FilePath &workingDirectory, const QString &modul
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, directory, arguments, VcsCommand::ForceCLocale);
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
msgCannotRun(arguments, directory, proc.stdErr(), errorMessage);
|
||||
msgCannotRun(arguments, directory, proc.cleanedStdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2219,7 +2219,7 @@ bool GitClient::cleanList(const FilePath &workingDirectory, const QString &modul
|
||||
const QString relativeBase = modulePath.isEmpty() ? QString() : modulePath + '/';
|
||||
const QString prefix = "Would remove ";
|
||||
const QStringList removeLines = Utils::filtered(
|
||||
splitLines(proc.stdOut()), [](const QString &s) {
|
||||
splitLines(proc.cleanedStdOut()), [](const QString &s) {
|
||||
return s.startsWith("Would remove ");
|
||||
});
|
||||
*files = Utils::transform(removeLines, [&relativeBase, &prefix](const QString &s) -> QString {
|
||||
@@ -2257,7 +2257,7 @@ bool GitClient::synchronousApplyPatch(const FilePath &workingDirectory,
|
||||
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments);
|
||||
const QString stdErr = proc.stdErr();
|
||||
const QString stdErr = proc.cleanedStdErr();
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess) {
|
||||
if (!stdErr.isEmpty())
|
||||
*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;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags);
|
||||
const QString stdOut = proc.stdOut();
|
||||
const QString stdOut = proc.cleanedStdOut();
|
||||
|
||||
if (output)
|
||||
*output = stdOut;
|
||||
@@ -2404,7 +2404,7 @@ GitClient::StatusResult GitClient::gitStatus(const FilePath &workingDirectory, S
|
||||
// Is it something really fatal?
|
||||
if (!statusRc && !branchKnown) {
|
||||
if (errorMessage) {
|
||||
*errorMessage = tr("Cannot obtain status: %1").arg(proc.stdErr());
|
||||
*errorMessage = tr("Cannot obtain status: %1").arg(proc.cleanedStdErr());
|
||||
}
|
||||
return StatusFailed;
|
||||
}
|
||||
@@ -2547,7 +2547,7 @@ QStringList GitClient::synchronousRepositoryBranches(const QString &repositoryUR
|
||||
// split "82bfad2f51d34e98b18982211c82220b8db049b<tab>refs/heads/master"
|
||||
bool headFound = false;
|
||||
bool branchFound = false;
|
||||
const QStringList lines = proc.stdOut().split('\n');
|
||||
const QStringList lines = proc.cleanedStdOut().split('\n');
|
||||
for (const QString &line : lines) {
|
||||
if (line.endsWith("\tHEAD")) {
|
||||
QTC_CHECK(headSha.isNull());
|
||||
@@ -3179,7 +3179,7 @@ void GitClient::synchronousAbortCommand(const FilePath &workingDir, const QStrin
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDir, {abortCommand, "--abort"},
|
||||
VcsCommand::ExpectRepoChanges | VcsCommand::ShowSuccessMessage);
|
||||
VcsOutputWindow::append(proc.stdOut());
|
||||
VcsOutputWindow::append(proc.cleanedStdOut());
|
||||
}
|
||||
|
||||
QString GitClient::synchronousTrackingBranch(const FilePath &workingDirectory, const QString &branch)
|
||||
@@ -3529,12 +3529,12 @@ bool GitClient::synchronousStashRemove(const FilePath &workingDirectory, const Q
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments);
|
||||
if (proc.result() == ProcessResult::FinishedWithSuccess) {
|
||||
const QString output = proc.stdOut();
|
||||
const QString output = proc.cleanedStdOut();
|
||||
if (!output.isEmpty())
|
||||
VcsOutputWindow::append(output);
|
||||
return true;
|
||||
} else {
|
||||
msgCannotRun(arguments, workingDirectory, proc.stdErr(), errorMessage);
|
||||
msgCannotRun(arguments, workingDirectory, proc.cleanedStdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -3548,11 +3548,11 @@ bool GitClient::synchronousStashList(const FilePath &workingDirectory, QList<Sta
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, VcsCommand::ForceCLocale);
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess) {
|
||||
msgCannotRun(arguments, workingDirectory, proc.stdErr(), errorMessage);
|
||||
msgCannotRun(arguments, workingDirectory, proc.cleanedStdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
Stash stash;
|
||||
const QStringList lines = splitLines(proc.stdOut());
|
||||
const QStringList lines = splitLines(proc.cleanedStdOut());
|
||||
for (const QString &line : lines) {
|
||||
if (stash.parseStashLine(line))
|
||||
stashes->push_back(stash);
|
||||
@@ -3589,7 +3589,7 @@ QString GitClient::readOneLine(const FilePath &workingDirectory, const QStringLi
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags, vcsTimeoutS(), codec);
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess)
|
||||
return QString();
|
||||
return proc.stdOut().trimmed();
|
||||
return proc.cleanedStdOut().trimmed();
|
||||
}
|
||||
|
||||
// determine version as '(major << 16) + (minor << 8) + patch' or 0.
|
||||
@@ -3615,13 +3615,13 @@ unsigned GitClient::synchronousGitVersion(QString *errorMessage) const
|
||||
QtcProcess proc;
|
||||
vcsSynchronousExec(proc, {}, {"--version"}, silentFlags);
|
||||
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;
|
||||
}
|
||||
|
||||
// cut 'git version 1.6.5.1.sha'
|
||||
// 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).*$");
|
||||
QTC_ASSERT(versionPattern.isValid(), return 0);
|
||||
const QRegularExpressionMatch match = versionPattern.match(output);
|
||||
|
@@ -238,7 +238,7 @@ static QByteArray decodeProvisioningProfile(const QString &path)
|
||||
p.runBlocking();
|
||||
if (p.result() != ProcessResult::FinishedWithSuccess)
|
||||
qCDebug(iosCommonLog) << "Reading signed provisioning file failed" << path;
|
||||
return p.stdOut().toLatin1();
|
||||
return p.cleanedStdOut().toLatin1();
|
||||
}
|
||||
|
||||
void IosConfigurations::updateAutomaticKitList()
|
||||
|
@@ -72,7 +72,7 @@ void XcodeProbe::detectDeveloperPaths()
|
||||
qCWarning(probeLog)
|
||||
<< QString::fromLatin1("Could not detect selected Xcode using xcode-select");
|
||||
else
|
||||
addDeveloperPath(selectedXcode.stdOut().trimmed());
|
||||
addDeveloperPath(selectedXcode.cleanedStdOut().trimmed());
|
||||
addDeveloperPath(defaultDeveloperPath);
|
||||
}
|
||||
|
||||
|
@@ -85,7 +85,7 @@ static bool runCommand(const CommandLine &command, QString *stdOutput, QString *
|
||||
p.setCommand(command);
|
||||
p.runBlocking();
|
||||
if (stdOutput)
|
||||
*stdOutput = p.stdOut();
|
||||
*stdOutput = p.cleanedStdOut();
|
||||
if (allOutput)
|
||||
*allOutput = p.allOutput();
|
||||
return p.result() == ProcessResult::FinishedWithSuccess;
|
||||
|
@@ -103,7 +103,7 @@ bool MercurialClient::manifestSync(const FilePath &repository, const QString &re
|
||||
const QDir repositoryDir(repository.toString());
|
||||
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) {
|
||||
const QFileInfo managedFile(repositoryDir, fileName);
|
||||
if (needle == managedFile)
|
||||
@@ -186,7 +186,7 @@ bool MercurialClient::synchronousPull(const FilePath &workingDir, const QString
|
||||
|
||||
const bool ok = proc.result() == ProcessResult::FinishedWithSuccess;
|
||||
|
||||
parsePullOutput(proc.stdOut().trimmed());
|
||||
parsePullOutput(proc.cleanedStdOut().trimmed());
|
||||
return ok;
|
||||
}
|
||||
|
||||
@@ -232,16 +232,16 @@ changeset: 0:031a48610fba
|
||||
user: ...
|
||||
\endcode */
|
||||
// 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) {
|
||||
VcsOutputWindow::appendSilently(
|
||||
msgParentRevisionFailed(workingDirectory, revision, msgParseParentsOutputFailed(proc.stdOut())));
|
||||
msgParentRevisionFailed(workingDirectory, revision, msgParseParentsOutputFailed(proc.cleanedStdOut())));
|
||||
return QStringList();
|
||||
}
|
||||
QStringList changeSets = lines.front().simplified().split(QLatin1Char(' '));
|
||||
if (changeSets.size() < 2) {
|
||||
VcsOutputWindow::appendSilently(
|
||||
msgParentRevisionFailed(workingDirectory, revision, msgParseParentsOutputFailed(proc.stdOut())));
|
||||
msgParentRevisionFailed(workingDirectory, revision, msgParseParentsOutputFailed(proc.cleanedStdOut())));
|
||||
return QStringList();
|
||||
}
|
||||
// Remove revision numbers
|
||||
@@ -270,7 +270,7 @@ QString MercurialClient::shortDescriptionSync(const FilePath &workingDirectory,
|
||||
vcsFullySynchronousExec(proc, workingDirectory, args);
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess)
|
||||
return revision;
|
||||
return stripLastNewline(proc.stdOut());
|
||||
return stripLastNewline(proc.cleanedStdOut());
|
||||
}
|
||||
|
||||
// Default format: "SHA1 (author summmary)"
|
||||
@@ -288,7 +288,7 @@ bool MercurialClient::managesFile(const FilePath &workingDirectory, const QStrin
|
||||
args << QLatin1String("status") << QLatin1String("--unknown") << fileName;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, args);
|
||||
return proc.stdOut().isEmpty();
|
||||
return proc.cleanedStdOut().isEmpty();
|
||||
}
|
||||
|
||||
void MercurialClient::incoming(const FilePath &repositoryRoot, const QString &repository)
|
||||
|
@@ -66,7 +66,7 @@ Version ToolWrapper::read_version(const Utils::FilePath &toolPath)
|
||||
process.setCommand({ toolPath, { "--version" } });
|
||||
process.start();
|
||||
if (process.waitForFinished())
|
||||
return Version::fromString(process.stdOut());
|
||||
return Version::fromString(process.cleanedStdOut());
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
@@ -63,7 +63,7 @@ static std::vector<NimbleTask> parseTasks(const FilePath &nimblePath, const File
|
||||
std::vector<NimbleTask> result;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ static NimbleMetadata parseMetadata(const FilePath &nimblePath, const FilePath &
|
||||
NimbleMetadata result = {};
|
||||
|
||||
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;
|
||||
}
|
||||
const QList<QByteArray> &lines = linesFromProcessOutput(&process);
|
||||
|
@@ -127,11 +127,11 @@ void PerforceChecker::slotDone()
|
||||
break;
|
||||
case QProcess::NormalExit:
|
||||
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").
|
||||
arg(m_binary.toUserOutput()).arg(m_process.exitCode()).arg(stdErr));
|
||||
} else {
|
||||
parseOutput(m_process.stdOut());
|
||||
parseOutput(m_process.cleanedStdOut());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@@ -1277,8 +1277,8 @@ PerforceResponse PerforcePluginPrivate::synchronousProcess(const FilePath &worki
|
||||
PerforceResponse response;
|
||||
response.error = true;
|
||||
response.exitCode = process.exitCode();
|
||||
response.stdErr = process.stdErr();
|
||||
response.stdOut = process.stdOut();
|
||||
response.stdErr = process.cleanedStdErr();
|
||||
response.stdOut = process.cleanedStdOut();
|
||||
switch (process.result()) {
|
||||
case ProcessResult::FinishedWithSuccess:
|
||||
response.error = false;
|
||||
|
@@ -118,7 +118,7 @@ static bool
|
||||
process.runBlocking(EventLoopMode::On);
|
||||
if (process.result() != Utils::ProcessResult::FinishedWithSuccess) {
|
||||
*errorMessage = QString("Generator script failed: %1").arg(process.exitMessage());
|
||||
const QString stdErr = process.stdErr();
|
||||
const QString stdErr = process.cleanedStdErr();
|
||||
if (!stdErr.isEmpty()) {
|
||||
errorMessage->append(QLatin1Char('\n'));
|
||||
errorMessage->append(stdErr);
|
||||
@@ -126,7 +126,7 @@ static bool
|
||||
return false;
|
||||
}
|
||||
if (stdOut) {
|
||||
*stdOut = process.stdOut();
|
||||
*stdOut = process.cleanedStdOut();
|
||||
if (CustomWizard::verbose())
|
||||
qDebug("Output: '%s'\n", qPrintable(*stdOut));
|
||||
}
|
||||
|
@@ -68,12 +68,12 @@ void SshDeviceProcessList::doKillProcess(const ProcessInfo &process)
|
||||
void SshDeviceProcessList::handleProcessDone()
|
||||
{
|
||||
if (d->m_process.result() == ProcessResult::FinishedWithSuccess) {
|
||||
reportProcessListUpdated(buildProcessList(d->m_process.stdOut()));
|
||||
reportProcessListUpdated(buildProcessList(d->m_process.cleanedStdOut()));
|
||||
} else {
|
||||
const QString errorMessage = d->m_process.exitStatus() == QProcess::NormalExit
|
||||
? tr("Process listing command failed with exit code %1.").arg(d->m_process.exitCode())
|
||||
: d->m_process.errorString();
|
||||
const QString stdErr = d->m_process.stdErr();
|
||||
const QString stdErr = d->m_process.cleanedStdErr();
|
||||
const QString fullMessage = stdErr.isEmpty()
|
||||
? errorMessage : errorMessage + '\n' + tr("Remote stderr was: %1").arg(stdErr);
|
||||
reportError(fullMessage);
|
||||
|
@@ -1590,7 +1590,7 @@ bool ClangToolChain::matchesCompilerCommand(const Utils::FilePath &command,
|
||||
std::unique_ptr<QtcProcess> xcrun(new QtcProcess);
|
||||
xcrun->setCommand({"/usr/bin/xcrun", {"-f", compilerCommand().fileName()}});
|
||||
xcrun->runBlocking();
|
||||
const FilePath output = FilePath::fromString(xcrun->stdOut().trimmed());
|
||||
const FilePath output = FilePath::fromString(xcrun->cleanedStdOut().trimmed());
|
||||
if (output.isExecutableFile() && output != compilerCommand())
|
||||
m_resolvedCompilerCommand = output;
|
||||
}
|
||||
|
@@ -296,7 +296,7 @@ static QVector<VisualStudioInstallation> detectVisualStudioFromVsWhere(const QSt
|
||||
return installations;
|
||||
}
|
||||
|
||||
QByteArray output = vsWhereProcess.stdOut().toUtf8();
|
||||
QByteArray output = vsWhereProcess.cleanedStdOut().toUtf8();
|
||||
QJsonParseError error;
|
||||
const QJsonDocument doc = QJsonDocument::fromJson(output, &error);
|
||||
if (error.error != QJsonParseError::NoError || doc.isNull()) {
|
||||
@@ -667,7 +667,7 @@ Macros MsvcToolChain::msvcPredefinedMacros(const QStringList &cxxflags,
|
||||
if (cpp.result() != ProcessResult::FinishedWithSuccess)
|
||||
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'); });
|
||||
for (const QString &line : output)
|
||||
predefinedMacros.append(Macro::fromKeyValue(line.mid(1)));
|
||||
@@ -1555,7 +1555,7 @@ static QVersionNumber clangClVersion(const FilePath &clangClPath)
|
||||
return {};
|
||||
const QRegularExpressionMatch match = QRegularExpression(
|
||||
QStringLiteral("clang version (\\d+(\\.\\d+)+)"))
|
||||
.match(clangClProcess.stdOut());
|
||||
.match(clangClProcess.cleanedStdOut());
|
||||
if (!match.hasMatch())
|
||||
return {};
|
||||
return QVersionNumber::fromString(match.captured(1));
|
||||
@@ -2127,7 +2127,7 @@ Utils::optional<QString> MsvcToolChain::generateEnvironmentSettings(const Utils:
|
||||
run.runBlocking();
|
||||
|
||||
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;
|
||||
QString command = QDir::toNativeSeparators(batchFile);
|
||||
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.
|
||||
const QString stdOut = run.stdOut();
|
||||
const QString stdOut = run.cleanedStdOut();
|
||||
|
||||
//
|
||||
// Now parse the file to get the environment settings
|
||||
|
@@ -78,7 +78,7 @@ static Interpreter createInterpreter(const FilePath &python,
|
||||
pythonProcess.setCommand({python, {"--version"}});
|
||||
pythonProcess.runBlocking();
|
||||
if (pythonProcess.result() == ProcessResult::FinishedWithSuccess)
|
||||
result.name = pythonProcess.stdOut().trimmed();
|
||||
result.name = pythonProcess.cleanedStdOut().trimmed();
|
||||
if (result.name.isEmpty())
|
||||
result.name = defaultName;
|
||||
if (windowedSuffix)
|
||||
|
@@ -125,7 +125,7 @@ EnvironmentItems QnxUtils::qnxEnvironmentFromEnvFile(const FilePath &filePath)
|
||||
return items;
|
||||
|
||||
// parsing process output
|
||||
const QString output = process.stdOut();
|
||||
const QString output = process.cleanedStdOut();
|
||||
for (const QString &line : output.split('\n')) {
|
||||
int equalIndex = line.indexOf('=');
|
||||
if (equalIndex < 0)
|
||||
|
@@ -1822,7 +1822,7 @@ static QByteArray runQmakeQuery(const FilePath &binary, const Environment &env,
|
||||
const QByteArray out = process.readAllStandardOutput();
|
||||
if (out.isEmpty()) {
|
||||
*error = QCoreApplication::translate("QtVersion", "\"%1\" produced no output: %2.")
|
||||
.arg(binary.displayName(), process.stdErr());
|
||||
.arg(binary.displayName(), process.cleanedStdErr());
|
||||
return {};
|
||||
}
|
||||
|
||||
|
@@ -146,7 +146,7 @@ QDateTime GenericDirectUploadService::timestampFromStat(const DeployableFile &fi
|
||||
error = tr("\"stat\" crashed.");
|
||||
} else if (statProc->exitCode() != 0) {
|
||||
error = tr("\"stat\" failed with exit code %1: %2")
|
||||
.arg(statProc->exitCode()).arg(statProc->stdErr());
|
||||
.arg(statProc->exitCode()).arg(statProc->cleanedStdErr());
|
||||
} else {
|
||||
succeeded = true;
|
||||
}
|
||||
|
@@ -260,7 +260,7 @@ QString SshSharedConnection::fullProcessError() const
|
||||
{
|
||||
const QString errorString = m_masterProcess->exitStatus() == QProcess::CrashExit
|
||||
? m_masterProcess->errorString() : QString();
|
||||
const QString standardError = m_masterProcess->stdErr();
|
||||
const QString standardError = m_masterProcess->cleanedStdErr();
|
||||
const QString errorPrefix = errorString.isEmpty() && standardError.isEmpty()
|
||||
? tr("SSH connection failure.") : tr("SSH connection failure:");
|
||||
QStringList allErrors {errorPrefix, errorString, standardError};
|
||||
|
@@ -183,7 +183,7 @@ void GenericLinuxDeviceTester::handleEchoDone()
|
||||
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)
|
||||
emit errorMessage(tr("Device replied to echo with unexpected contents.") + '\n');
|
||||
else
|
||||
|
@@ -80,7 +80,7 @@ PublicKeyDeploymentDialog::PublicKeyDeploymentDialog(const IDevice::ConstPtr &de
|
||||
if (!succeeded) {
|
||||
QString errorMessage = d->m_process.errorString();
|
||||
if (errorMessage.isEmpty())
|
||||
errorMessage = d->m_process.stdErr();
|
||||
errorMessage = d->m_process.cleanedStdErr();
|
||||
if (errorMessage.endsWith('\n'))
|
||||
errorMessage.chop(1);
|
||||
finalMessage = tr("Key deployment failed.");
|
||||
|
@@ -52,7 +52,7 @@ public:
|
||||
connect(&m_mkdir, &QtcProcess::done, this, [this] {
|
||||
if (m_mkdir.result() != ProcessResult::FinishedWithSuccess) {
|
||||
QString finalMessage = m_mkdir.errorString();
|
||||
const QString stdErr = m_mkdir.stdErr();
|
||||
const QString stdErr = m_mkdir.cleanedStdErr();
|
||||
if (!stdErr.isEmpty()) {
|
||||
if (!finalMessage.isEmpty())
|
||||
finalMessage += '\n';
|
||||
|
@@ -90,7 +90,7 @@ bool isSilverSearcherAvailable()
|
||||
silverSearcherProcess.setCommand({"ag", {"--version"}});
|
||||
silverSearcherProcess.start();
|
||||
if (silverSearcherProcess.waitForFinished(1000)) {
|
||||
if (silverSearcherProcess.stdOut().contains("ag version"))
|
||||
if (silverSearcherProcess.cleanedStdOut().contains("ag version"))
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ void runSilverSeacher(FutureInterfaceType &fi, FileFindParameters parameters)
|
||||
regexp.setPattern(parameters.text);
|
||||
regexp.setPatternOptions(patternOptions);
|
||||
}
|
||||
SilverSearcher::SilverSearcherOutputParser parser(process.stdOut(), regexp);
|
||||
SilverSearcher::SilverSearcherOutputParser parser(process.cleanedStdOut(), regexp);
|
||||
FileSearchResultList items = parser.parse();
|
||||
if (!items.isEmpty())
|
||||
fi.reportResult(items);
|
||||
|
@@ -157,7 +157,7 @@ QString SubversionClient::synchronousTopic(const FilePath &repository) const
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess)
|
||||
return QString();
|
||||
|
||||
return proc.stdOut().trimmed();
|
||||
return proc.cleanedStdOut().trimmed();
|
||||
}
|
||||
|
||||
QString SubversionClient::escapeFile(const QString &file)
|
||||
|
@@ -1034,8 +1034,8 @@ SubversionResponse SubversionPluginPrivate::runSvn(const FilePath &workingDir,
|
||||
response.error = proc.result() != ProcessResult::FinishedWithSuccess;
|
||||
if (response.error)
|
||||
response.message = proc.exitMessage();
|
||||
response.stdErr = proc.stdErr();
|
||||
response.stdOut = proc.stdOut();
|
||||
response.stdErr = proc.cleanedStdErr();
|
||||
response.stdOut = proc.cleanedStdOut();
|
||||
return response;
|
||||
}
|
||||
|
||||
|
@@ -97,7 +97,7 @@ static FormatTask format(FormatTask task)
|
||||
.arg(process.exitMessage());
|
||||
return task;
|
||||
}
|
||||
const QString output = process.stdErr();
|
||||
const QString output = process.cleanedStdErr();
|
||||
if (!output.isEmpty())
|
||||
task.error = executable + QLatin1String(": ") + output;
|
||||
|
||||
|
@@ -71,7 +71,7 @@ FilePath findFallbackDefinitionsLocation()
|
||||
process.setCommand({program, {"--prefix"}});
|
||||
process.runBlocking();
|
||||
if (process.result() == ProcessResult::FinishedWithSuccess) {
|
||||
QString output = process.stdOut();
|
||||
QString output = process.cleanedStdOut();
|
||||
output.remove('\n');
|
||||
const FilePath dir = FilePath::fromString(output);
|
||||
for (auto &kateSyntaxPath : kateSyntaxPaths) {
|
||||
|
@@ -167,7 +167,7 @@ void UpdateInfoPlugin::startCheckForUpdates()
|
||||
this,
|
||||
[this, futureIf]() mutable {
|
||||
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) {
|
||||
d->m_maintenanceToolProcess.reset(new QtcProcess);
|
||||
d->m_maintenanceToolProcess->setCommand(
|
||||
@@ -181,7 +181,7 @@ void UpdateInfoPlugin::startCheckForUpdates()
|
||||
[this, futureIf]() mutable {
|
||||
if (d->m_maintenanceToolProcess->result()
|
||||
== ProcessResult::FinishedWithSuccess) {
|
||||
d->m_packagesOutput = d->m_maintenanceToolProcess->stdOut();
|
||||
d->m_packagesOutput = d->m_maintenanceToolProcess->cleanedStdOut();
|
||||
d->m_maintenanceToolProcess.reset();
|
||||
futureIf.reportFinished();
|
||||
checkForUpdatesFinished();
|
||||
|
@@ -211,7 +211,7 @@ void ValgrindRunner::Private::findPidProcessDone()
|
||||
emit q->processOutputReceived(m_findPID.allOutput(), StdErrFormat);
|
||||
return;
|
||||
}
|
||||
QString out = m_findPID.stdOut();
|
||||
QString out = m_findPID.cleanedStdOut();
|
||||
if (out.isEmpty())
|
||||
return;
|
||||
bool ok;
|
||||
|
@@ -277,7 +277,7 @@ bool VcsBaseClient::synchronousCreateRepository(const FilePath &workingDirectory
|
||||
vcsFullySynchronousExec(proc, workingDirectory, args);
|
||||
if (proc.result() != ProcessResult::FinishedWithSuccess)
|
||||
return false;
|
||||
VcsOutputWindow::append(proc.stdOut());
|
||||
VcsOutputWindow::append(proc.cleanedStdOut());
|
||||
|
||||
resetCachedVcsInfo(workingDirectory);
|
||||
|
||||
|
@@ -118,7 +118,7 @@ QVersionNumber WebAssemblyEmSdk::version(const FilePath &sdkRoot)
|
||||
emcc.setCommand(command);
|
||||
emcc.setEnvironment(env);
|
||||
emcc.runBlocking();
|
||||
const QString version = emcc.stdOut();
|
||||
const QString version = emcc.cleanedStdOut();
|
||||
emSdkVersionCache()->insert(cacheKey,
|
||||
new QVersionNumber(QVersionNumber::fromString(version)));
|
||||
}
|
||||
|
Reference in New Issue
Block a user