forked from qt-creator/qt-creator
Utils: Rename QtcProcess::Result::Finished to FinishedWithSuccess
To make clear that this is not just any finish. Also change FinishedError to FinishedWithError, to create symmetry. Also adapt enum member description to reality. Change-Id: I13e05391eb86fdb24e2ae660f14dfddb282e1104 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -422,7 +422,7 @@ QString PluginManager::systemInformation()
|
||||
SynchronousProcess qtDiagProc;
|
||||
qtDiagProc.setCommand(qtDiag);
|
||||
qtDiagProc.runBlocking();
|
||||
if (qtDiagProc.result() == QtcProcess::Finished)
|
||||
if (qtDiagProc.result() == QtcProcess::FinishedWithSuccess)
|
||||
result += qtDiagProc.allOutput() + "\n";
|
||||
result += "Plugin information:\n\n";
|
||||
auto longestSpec = std::max_element(d->pluginSpecs.cbegin(), d->pluginSpecs.cend(),
|
||||
|
@@ -48,7 +48,7 @@ QString BuildableHelperLibrary::qtChooserToQmakePath(const QString &path)
|
||||
proc.setTimeoutS(1);
|
||||
proc.setCommand({path, {"-print-env"}});
|
||||
proc.runBlocking();
|
||||
if (proc.result() != QtcProcess::Finished)
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess)
|
||||
return QString();
|
||||
const QString output = proc.stdOut();
|
||||
int pos = output.indexOf(toolDir);
|
||||
@@ -133,7 +133,7 @@ QString BuildableHelperLibrary::qtVersionForQMake(const QString &qmakePath)
|
||||
qmake.setTimeoutS(5);
|
||||
qmake.setCommand({qmakePath, {"--version"}});
|
||||
qmake.runBlocking();
|
||||
if (qmake.result() != QtcProcess::Finished) {
|
||||
if (qmake.result() != QtcProcess::FinishedWithSuccess) {
|
||||
qWarning() << qmake.exitMessage();
|
||||
return QString();
|
||||
}
|
||||
|
@@ -153,7 +153,7 @@ QString BinaryVersionToolTipEventFilter::toolVersion(const CommandLine &cmd)
|
||||
proc.setTimeoutS(1);
|
||||
proc.setCommand(cmd);
|
||||
proc.runBlocking();
|
||||
if (proc.result() != QtcProcess::Finished)
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess)
|
||||
return QString();
|
||||
return proc.allOutput();
|
||||
}
|
||||
|
@@ -223,7 +223,7 @@ QtcProcess::Result QtcProcessPrivate::interpretExitCode(int exitCode)
|
||||
return m_exitCodeInterpreter(exitCode);
|
||||
|
||||
// default:
|
||||
return exitCode ? QtcProcess::FinishedError : QtcProcess::Finished;
|
||||
return exitCode ? QtcProcess::FinishedWithError : QtcProcess::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
} // Internal
|
||||
@@ -775,9 +775,9 @@ QString QtcProcess::exitMessage()
|
||||
{
|
||||
const QString fullCmd = commandLine().toUserOutput();
|
||||
switch (result()) {
|
||||
case Finished:
|
||||
case FinishedWithSuccess:
|
||||
return QtcProcess::tr("The command \"%1\" finished successfully.").arg(fullCmd);
|
||||
case FinishedError:
|
||||
case FinishedWithError:
|
||||
return QtcProcess::tr("The command \"%1\" terminated with exit code %2.")
|
||||
.arg(fullCmd).arg(exitCode());
|
||||
case TerminatedAbnormally:
|
||||
@@ -971,7 +971,7 @@ void SynchronousProcess::runBlocking()
|
||||
|
||||
waitForFinished();
|
||||
|
||||
d->m_result = QtcProcess::Finished;
|
||||
d->m_result = QtcProcess::FinishedWithSuccess;
|
||||
d->m_exitCode = exitCode();
|
||||
return;
|
||||
};
|
||||
|
@@ -61,16 +61,21 @@ public:
|
||||
~QtcProcess();
|
||||
|
||||
enum Result {
|
||||
// Finished with return code 0
|
||||
Finished,
|
||||
// Finished with return code != 0
|
||||
FinishedError,
|
||||
// Finished successfully. Unless an ExitCodeInterpreter is set
|
||||
// this corresponds to a return code 0.
|
||||
FinishedWithSuccess,
|
||||
Finished = FinishedWithSuccess, // FIXME: Kept to ease downstream transition
|
||||
// Finished unsuccessfully. Unless an ExitCodeInterpreter is set
|
||||
// this corresponds to a return code different from 0.
|
||||
FinishedWithError,
|
||||
FinishedError = FinishedWithError, // FIXME: Kept to ease downstream transition
|
||||
// Process terminated abnormally (kill)
|
||||
TerminatedAbnormally,
|
||||
// Executable could not be started
|
||||
StartFailed,
|
||||
// Hang, no output after time out
|
||||
Hang };
|
||||
Hang
|
||||
};
|
||||
|
||||
void setEnvironment(const Environment &env);
|
||||
const Environment &environment() const;
|
||||
|
@@ -280,7 +280,7 @@ void ShellCommand::run(QFutureInterface<void> &future)
|
||||
stdOut += proc.stdOut();
|
||||
stdErr += proc.stdErr();
|
||||
d->m_lastExecExitCode = proc.exitCode();
|
||||
d->m_lastExecSuccess = proc.result() == QtcProcess::Finished;
|
||||
d->m_lastExecSuccess = proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
if (!d->m_lastExecSuccess)
|
||||
break;
|
||||
}
|
||||
@@ -334,7 +334,7 @@ void ShellCommand::runCommand(SynchronousProcess &proc,
|
||||
|
||||
if (!d->m_aborted) {
|
||||
// Success/Fail message in appropriate window?
|
||||
if (proc.result() == QtcProcess::Finished) {
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
if (d->m_flags & ShowSuccessMessage)
|
||||
emit proxy->appendMessage(proc.exitMessage());
|
||||
} else if (!(d->m_flags & SuppressFailMessage)) {
|
||||
|
@@ -72,7 +72,7 @@ bool AndroidAvdManager::avdManagerCommand(const AndroidConfig &config, const QSt
|
||||
qCDebug(avdManagerLog) << "Running AVD Manager command:" << cmd.toUserOutput();
|
||||
proc.setCommand(cmd);
|
||||
proc.runBlocking();
|
||||
if (proc.result() == Utils::QtcProcess::Finished) {
|
||||
if (proc.result() == Utils::QtcProcess::FinishedWithSuccess) {
|
||||
if (output)
|
||||
*output = proc.allOutput();
|
||||
return true;
|
||||
@@ -204,7 +204,7 @@ bool AndroidAvdManager::removeAvd(const QString &name) const
|
||||
proc.setTimeoutS(5);
|
||||
proc.setCommand(command);
|
||||
proc.runBlocking();
|
||||
return proc.result() == QtcProcess::Finished && proc.exitCode() == 0;
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess && proc.exitCode() == 0;
|
||||
}
|
||||
|
||||
static void avdConfigEditManufacturerTag(const QString &avdPathStr, bool recoverMode = false)
|
||||
@@ -354,7 +354,7 @@ bool AndroidAvdManager::isAvdBooted(const QString &device) const
|
||||
adbProc.setTimeoutS(10);
|
||||
adbProc.setCommand(command);
|
||||
adbProc.runBlocking();
|
||||
if (adbProc.result() != QtcProcess::Finished)
|
||||
if (adbProc.result() != QtcProcess::FinishedWithSuccess)
|
||||
return false;
|
||||
QString value = adbProc.allOutput().trimmed();
|
||||
return value == "stopped";
|
||||
|
@@ -1011,7 +1011,7 @@ QAbstractItemModel *AndroidBuildApkStep::keystoreCertificates()
|
||||
keytoolProc.setCommand({AndroidConfigurations::currentConfig().keytoolPath(), params});
|
||||
keytoolProc.setProcessUserEventWhileRunning();
|
||||
keytoolProc.runBlocking();
|
||||
if (keytoolProc.result() > QtcProcess::FinishedError)
|
||||
if (keytoolProc.result() > QtcProcess::FinishedWithError)
|
||||
QMessageBox::critical(nullptr, tr("Error"), tr("Failed to run keytool."));
|
||||
else
|
||||
model = new CertificatesModel(keytoolProc.stdOut(), this);
|
||||
|
@@ -161,7 +161,7 @@ namespace {
|
||||
proc.setTimeoutS(30);
|
||||
proc.setCommand({executable, {shell}});
|
||||
proc.runBlocking();
|
||||
if (proc.result() != QtcProcess::Finished)
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess)
|
||||
return true;
|
||||
return !proc.allOutput().contains("x86-64");
|
||||
}
|
||||
@@ -565,7 +565,7 @@ QVector<AndroidDeviceInfo> AndroidConfig::connectedDevices(const FilePath &adbTo
|
||||
CommandLine cmd{adbToolPath, {"devices"}};
|
||||
adbProc.setCommand(cmd);
|
||||
adbProc.runBlocking();
|
||||
if (adbProc.result() != QtcProcess::Finished) {
|
||||
if (adbProc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (error)
|
||||
*error = QApplication::translate("AndroidConfiguration", "Could not run: %1")
|
||||
.arg(cmd.toUserOutput());
|
||||
@@ -634,7 +634,7 @@ QString AndroidConfig::getDeviceProperty(const FilePath &adbToolPath, const QStr
|
||||
adbProc.setTimeoutS(10);
|
||||
adbProc.setCommand(cmd);
|
||||
adbProc.runBlocking();
|
||||
if (adbProc.result() != QtcProcess::Finished)
|
||||
if (adbProc.result() != QtcProcess::FinishedWithSuccess)
|
||||
return QString();
|
||||
|
||||
return adbProc.allOutput();
|
||||
@@ -732,7 +732,7 @@ QStringList AndroidConfig::getAbis(const FilePath &adbToolPath, const QString &d
|
||||
adbProc.setTimeoutS(10);
|
||||
adbProc.setCommand({adbToolPath, arguments});
|
||||
adbProc.runBlocking();
|
||||
if (adbProc.result() != QtcProcess::Finished)
|
||||
if (adbProc.result() != QtcProcess::FinishedWithSuccess)
|
||||
return result;
|
||||
|
||||
QString output = adbProc.allOutput().trimmed();
|
||||
@@ -755,7 +755,7 @@ QStringList AndroidConfig::getAbis(const FilePath &adbToolPath, const QString &d
|
||||
abiProc.setTimeoutS(10);
|
||||
abiProc.setCommand({adbToolPath, arguments});
|
||||
abiProc.runBlocking();
|
||||
if (abiProc.result() != QtcProcess::Finished)
|
||||
if (abiProc.result() != QtcProcess::FinishedWithSuccess)
|
||||
return result;
|
||||
|
||||
QString abi = abiProc.allOutput().trimmed();
|
||||
|
@@ -202,7 +202,7 @@ void AndroidCreateKeystoreCertificate::buttonBoxAccepted()
|
||||
genKeyCertProc.setProcessUserEventWhileRunning();
|
||||
genKeyCertProc.runBlocking();
|
||||
|
||||
if (genKeyCertProc.result() != QtcProcess::Finished || genKeyCertProc.exitCode() != 0) {
|
||||
if (genKeyCertProc.result() != QtcProcess::FinishedWithSuccess || genKeyCertProc.exitCode() != 0) {
|
||||
QMessageBox::critical(this, tr("Error"),
|
||||
genKeyCertProc.exitMessage() + '\n' + genKeyCertProc.allOutput());
|
||||
return;
|
||||
|
@@ -485,7 +485,7 @@ void AndroidDeployQtStep::runCommand(const CommandLine &command)
|
||||
buildProc.setCommand(command);
|
||||
buildProc.setProcessUserEventWhileRunning();
|
||||
buildProc.runBlocking();
|
||||
if (buildProc.result() != QtcProcess::Finished || buildProc.exitCode() != 0) {
|
||||
if (buildProc.result() != QtcProcess::FinishedWithSuccess || buildProc.exitCode() != 0) {
|
||||
const QString error = buildProc.exitMessage();
|
||||
emit addOutput(error, OutputFormat::ErrorMessage);
|
||||
TaskHub::addTask(DeploymentTask(Task::Error, error));
|
||||
|
@@ -539,7 +539,7 @@ bool AndroidManager::checkKeystorePassword(const QString &keystorePath, const QS
|
||||
proc.setCommand(cmd);
|
||||
proc.setProcessUserEventWhileRunning();
|
||||
proc.runBlocking();
|
||||
return proc.result() == QtcProcess::Finished && proc.exitCode() == 0;
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess && proc.exitCode() == 0;
|
||||
}
|
||||
|
||||
bool AndroidManager::checkCertificatePassword(const QString &keystorePath, const QString &keystorePasswd, const QString &alias, const QString &certificatePasswd)
|
||||
@@ -557,7 +557,7 @@ bool AndroidManager::checkCertificatePassword(const QString &keystorePath, const
|
||||
proc.setCommand({AndroidConfigurations::currentConfig().keytoolPath(), arguments});
|
||||
proc.setProcessUserEventWhileRunning();
|
||||
proc.runBlocking();
|
||||
return proc.result() == QtcProcess::Finished && proc.exitCode() == 0;
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess && proc.exitCode() == 0;
|
||||
}
|
||||
|
||||
bool AndroidManager::checkCertificateExists(const QString &keystorePath,
|
||||
@@ -572,7 +572,7 @@ bool AndroidManager::checkCertificateExists(const QString &keystorePath,
|
||||
proc.setCommand({AndroidConfigurations::currentConfig().keytoolPath(), arguments});
|
||||
proc.setProcessUserEventWhileRunning();
|
||||
proc.runBlocking();
|
||||
return proc.result() == QtcProcess::Finished && proc.exitCode() == 0;
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess && proc.exitCode() == 0;
|
||||
}
|
||||
|
||||
using GradleProperties = QMap<QByteArray, QByteArray>;
|
||||
@@ -732,7 +732,7 @@ SdkToolResult AndroidManager::runCommand(const CommandLine &command,
|
||||
cmdProc.runBlocking();
|
||||
cmdResult.m_stdOut = cmdProc.stdOut().trimmed();
|
||||
cmdResult.m_stdErr = cmdProc.stdErr().trimmed();
|
||||
cmdResult.m_success = cmdProc.result() == QtcProcess::Finished;
|
||||
cmdResult.m_success = cmdProc.result() == QtcProcess::FinishedWithSuccess;
|
||||
qCDebug(androidManagerLog) << "Command finshed (sync):" << command.toUserOutput()
|
||||
<< "Success:" << cmdResult.m_success
|
||||
<< "Output:" << cmdProc.allRawOutput();
|
||||
|
@@ -160,7 +160,7 @@ static bool sdkManagerCommand(const AndroidConfig &config, const QStringList &ar
|
||||
proc.runBlocking();
|
||||
if (output)
|
||||
*output = proc.allOutput();
|
||||
return proc.result() == QtcProcess::Finished;
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -207,7 +207,7 @@ static void sdkManagerCommand(const AndroidConfig &config, const QStringList &ar
|
||||
"The operation requires user interaction. "
|
||||
"Use the \"sdkmanager\" command-line tool.");
|
||||
} else {
|
||||
output.success = proc.result() == QtcProcess::Finished;
|
||||
output.success = proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -113,7 +113,7 @@ static Macros dumpPredefinedMacros(const FilePath &compiler, const QStringList &
|
||||
|
||||
cpp.setCommand(cmd);
|
||||
cpp.runBlocking();
|
||||
if (cpp.result() != QtcProcess::Finished || cpp.exitCode() != 0) {
|
||||
if (cpp.result() != QtcProcess::FinishedWithSuccess || cpp.exitCode() != 0) {
|
||||
qWarning() << cpp.exitMessage();
|
||||
return {};
|
||||
}
|
||||
|
@@ -287,7 +287,7 @@ static Macros dumpArmPredefinedMacros(const FilePath &compiler, const QStringLis
|
||||
cpp.setCommand({compiler, args});
|
||||
|
||||
cpp.runBlocking();
|
||||
if (cpp.result() != QtcProcess::Finished || cpp.exitCode() != 0) {
|
||||
if (cpp.result() != QtcProcess::FinishedWithSuccess || cpp.exitCode() != 0) {
|
||||
qWarning() << cpp.exitMessage();
|
||||
return {};
|
||||
}
|
||||
|
@@ -93,7 +93,7 @@ static Macros dumpPredefinedMacros(const FilePath &compiler, const Environment &
|
||||
cpp.setCommand({compiler, {compilerTargetFlag(abi), "-dM", "-E", fakeIn.fileName()}});
|
||||
|
||||
cpp.runBlocking();
|
||||
if (cpp.result() != QtcProcess::Finished || cpp.exitCode() != 0) {
|
||||
if (cpp.result() != QtcProcess::FinishedWithSuccess || cpp.exitCode() != 0) {
|
||||
qWarning() << cpp.exitMessage();
|
||||
return {};
|
||||
}
|
||||
@@ -114,7 +114,7 @@ static HeaderPaths dumpHeaderPaths(const FilePath &compiler, const Environment &
|
||||
cpp.setCommand({compiler, {compilerTargetFlag(abi), "--print-search-dirs"}});
|
||||
|
||||
cpp.runBlocking();
|
||||
if (cpp.result() != QtcProcess::Finished || cpp.exitCode() != 0) {
|
||||
if (cpp.result() != QtcProcess::FinishedWithSuccess || cpp.exitCode() != 0) {
|
||||
qWarning() << cpp.exitMessage();
|
||||
return {};
|
||||
}
|
||||
|
@@ -153,7 +153,7 @@ bool BazaarClient::synchronousUncommit(const QString &workingDir,
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDir, args);
|
||||
VcsOutputWindow::append(proc.stdOut());
|
||||
return proc.result() == QtcProcess::Finished;
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
void BazaarClient::commit(const QString &repositoryRoot, const QStringList &files,
|
||||
@@ -193,7 +193,7 @@ bool BazaarClient::managesFile(const QString &workingDirectory, const QString &f
|
||||
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, args);
|
||||
if (proc.result() != QtcProcess::Finished)
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess)
|
||||
return false;
|
||||
return proc.rawStdOut().startsWith("unknown");
|
||||
}
|
||||
@@ -233,8 +233,8 @@ ExitCodeInterpreter BazaarClient::exitCodeInterpreter(VcsCommandTag cmd) const
|
||||
{
|
||||
if (cmd == DiffCommand) {
|
||||
return [](int code) {
|
||||
return (code < 0 || code > 2) ? QtcProcess::FinishedError
|
||||
: QtcProcess::Finished;
|
||||
return (code < 0 || code > 2) ? QtcProcess::FinishedWithError
|
||||
: QtcProcess::FinishedWithSuccess;
|
||||
};
|
||||
}
|
||||
return {};
|
||||
|
@@ -86,7 +86,7 @@ static int updateVersionHelper(const Utils::FilePath &command)
|
||||
Utils::SynchronousProcess process;
|
||||
process.setCommand({command, {"--version"}});
|
||||
process.runBlocking();
|
||||
if (process.result() != Utils::QtcProcess::Finished)
|
||||
if (process.result() != Utils::QtcProcess::FinishedWithSuccess)
|
||||
return 0;
|
||||
|
||||
// Astyle prints the version on stdout or stderr, depending on platform
|
||||
@@ -184,7 +184,7 @@ void ArtisticStyleSettings::createDocumentationFile() const
|
||||
process.setTimeoutS(2);
|
||||
process.setCommand({command(), {"-h"}});
|
||||
process.runBlocking();
|
||||
if (process.result() != Utils::QtcProcess::Finished)
|
||||
if (process.result() != Utils::QtcProcess::FinishedWithSuccess)
|
||||
return;
|
||||
|
||||
QFile file(documentationFilePath());
|
||||
|
@@ -152,7 +152,7 @@ void UncrustifySettings::createDocumentationFile() const
|
||||
process.setTimeoutS(2);
|
||||
process.setCommand({command(), {"--show-config"}});
|
||||
process.runBlocking();
|
||||
if (process.result() != Utils::QtcProcess::Finished)
|
||||
if (process.result() != Utils::QtcProcess::FinishedWithSuccess)
|
||||
return;
|
||||
|
||||
QFile file(documentationFilePath());
|
||||
|
@@ -57,9 +57,9 @@ static QString runExecutable(const Utils::CommandLine &commandLine,
|
||||
cpp.setCommand(commandLine);
|
||||
|
||||
cpp.runBlocking();
|
||||
if (cpp.result() != QtcProcess::Finished
|
||||
if (cpp.result() != QtcProcess::FinishedWithSuccess
|
||||
&& (failSilently == FailSilently::No
|
||||
|| cpp.result() != QtcProcess::FinishedError)) {
|
||||
|| cpp.result() != QtcProcess::FinishedWithError)) {
|
||||
Core::MessageManager::writeFlashing(cpp.exitMessage());
|
||||
Core::MessageManager::writeFlashing(QString::fromUtf8(cpp.allRawOutput()));
|
||||
return {};
|
||||
|
@@ -1675,7 +1675,7 @@ ClearCasePluginPrivate::runCleartool(const QString &workingDir,
|
||||
command.setCodec(outputCodec);
|
||||
command.runCommand(proc, {executable, arguments});
|
||||
|
||||
response.error = proc.result() != QtcProcess::Finished;
|
||||
response.error = proc.result() != QtcProcess::FinishedWithSuccess;
|
||||
if (response.error)
|
||||
response.message = proc.exitMessage();
|
||||
response.stdErr = proc.stdErr();
|
||||
@@ -2361,7 +2361,7 @@ QString ClearCasePluginPrivate::runExtDiff(const QString &workingDir, const QStr
|
||||
process.setCommand(diff);
|
||||
process.setProcessUserEventWhileRunning();
|
||||
process.runBlocking();
|
||||
if (process.result() != QtcProcess::Finished)
|
||||
if (process.result() != QtcProcess::FinishedWithSuccess)
|
||||
return QString();
|
||||
return process.allOutput();
|
||||
}
|
||||
|
@@ -283,19 +283,19 @@ TextEditor::Keywords CMakeTool::keywords()
|
||||
if (m_introspection->m_functions.isEmpty() && m_introspection->m_didRun) {
|
||||
SynchronousProcess proc;
|
||||
runCMake(proc, {"--help-command-list"}, 5);
|
||||
if (proc.result() == QtcProcess::Finished)
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess)
|
||||
m_introspection->m_functions = proc.stdOut().split('\n');
|
||||
|
||||
runCMake(proc, {"--help-commands"}, 5);
|
||||
if (proc.result() == QtcProcess::Finished)
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess)
|
||||
parseFunctionDetailsOutput(proc.stdOut());
|
||||
|
||||
runCMake(proc, {"--help-property-list"}, 5);
|
||||
if (proc.result() == QtcProcess::Finished)
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess)
|
||||
m_introspection->m_variables = parseVariableOutput(proc.stdOut());
|
||||
|
||||
runCMake(proc, {"--help-variable-list"}, 5);
|
||||
if (proc.result() == QtcProcess::Finished) {
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
m_introspection->m_variables.append(parseVariableOutput(proc.stdOut()));
|
||||
m_introspection->m_variables = Utils::filteredUnique(m_introspection->m_variables);
|
||||
Utils::sort(m_introspection->m_variables);
|
||||
@@ -485,7 +485,7 @@ void CMakeTool::fetchFromCapabilities() const
|
||||
SynchronousProcess cmake;
|
||||
runCMake(cmake, {"-E", "capabilities"});
|
||||
|
||||
if (cmake.result() == QtcProcess::Finished) {
|
||||
if (cmake.result() == QtcProcess::FinishedWithSuccess) {
|
||||
m_introspection->m_didRun = true;
|
||||
parseFromCapabilities(cmake.stdOut());
|
||||
} else {
|
||||
|
@@ -204,8 +204,8 @@ public:
|
||||
{
|
||||
if (cmd == DiffCommand) {
|
||||
return [](int code) {
|
||||
return (code < 0 || code > 2) ? QtcProcess::FinishedError
|
||||
: QtcProcess::Finished;
|
||||
return (code < 0 || code > 2) ? QtcProcess::FinishedWithError
|
||||
: QtcProcess::FinishedWithSuccess;
|
||||
};
|
||||
}
|
||||
return {};
|
||||
@@ -1458,10 +1458,10 @@ CvsResponse CvsPluginPrivate::runCvs(const QString &workingDirectory,
|
||||
response.stdErr = proc.stdErr();
|
||||
response.stdOut = proc.stdOut();
|
||||
switch (proc.result()) {
|
||||
case QtcProcess::Finished:
|
||||
case QtcProcess::FinishedWithSuccess:
|
||||
response.result = CvsResponse::Ok;
|
||||
break;
|
||||
case QtcProcess::FinishedError:
|
||||
case QtcProcess::FinishedWithError:
|
||||
response.result = CvsResponse::NonNullExitCode;
|
||||
break;
|
||||
case QtcProcess::TerminatedAbnormally:
|
||||
|
@@ -188,7 +188,7 @@ void DebuggerItem::reinitializeFromFile(const Utils::Environment &sysEnv)
|
||||
proc.setEnvironment(sysEnv);
|
||||
proc.setCommand({m_command, {version}});
|
||||
proc.runBlocking();
|
||||
if (proc.result() != QtcProcess::Finished) {
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
m_engineType = NoEngineType;
|
||||
return;
|
||||
}
|
||||
|
@@ -747,7 +747,7 @@ void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers()
|
||||
proc.setTimeoutS(2);
|
||||
proc.setCommand({"xcrun", {"--find", "lldb"}});
|
||||
proc.runBlocking();
|
||||
if (proc.result() == QtcProcess::Finished) {
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
QString lPath = proc.allOutput().trimmed();
|
||||
if (!lPath.isEmpty()) {
|
||||
const QFileInfo fi(lPath);
|
||||
|
@@ -4981,7 +4981,7 @@ CoreInfo CoreInfo::readExecutableNameFromCore(const Runnable &debugger, const QS
|
||||
proc.setCommand({debugger.executable, args});
|
||||
proc.runBlocking();
|
||||
|
||||
if (proc.result() == QtcProcess::Finished) {
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
QString output = proc.stdOut();
|
||||
// Core was generated by `/data/dev/creator-2.6/bin/qtcreator'.
|
||||
// Program terminated with signal 11, Segmentation fault.
|
||||
|
@@ -247,7 +247,7 @@ int GerritServer::testConnection()
|
||||
SynchronousProcess proc;
|
||||
client->vcsFullySynchronousExec(proc, QString(), {curlBinary, arguments},
|
||||
Core::ShellCommand::NoOutput);
|
||||
if (proc.result() == QtcProcess::Finished) {
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
QString output = proc.stdOut();
|
||||
// Gerrit returns an empty response for /p/qt-creator/a/accounts/self
|
||||
// so consider this as 404.
|
||||
@@ -358,7 +358,7 @@ void GerritServer::resolveVersion(const GerritParameters &p, bool forceReload)
|
||||
Core::ShellCommand::NoOutput);
|
||||
// REST endpoint for version is only available from 2.8 and up. Do not consider invalid
|
||||
// if it fails.
|
||||
if (proc.result() == QtcProcess::Finished) {
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
QString output = proc.stdOut();
|
||||
if (output.isEmpty())
|
||||
return;
|
||||
|
@@ -675,7 +675,7 @@ public:
|
||||
{
|
||||
ConflictHandler handler(workingDirectory, abortCommand);
|
||||
// No conflicts => do nothing
|
||||
if (proc.result() == QtcProcess::Finished)
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess)
|
||||
return;
|
||||
handler.readStdOut(proc.stdOut());
|
||||
handler.readStdErr(proc.stdErr());
|
||||
@@ -841,7 +841,7 @@ bool GitClient::managesFile(const QString &workingDirectory, const QString &file
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, {"ls-files", "--error-unmatch", fileName},
|
||||
Core::ShellCommand::NoOutput);
|
||||
return proc.result() == QtcProcess::Finished;
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
QStringList GitClient::unmanagedFiles(const QStringList &filePaths) const
|
||||
@@ -858,7 +858,7 @@ QStringList GitClient::unmanagedFiles(const QStringList &filePaths) const
|
||||
args << transform(it.value(), [&wd](const QString &fp) { return wd.relativeFilePath(fp); });
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, it.key(), args, Core::ShellCommand::NoOutput);
|
||||
if (proc.result() != QtcProcess::Finished)
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess)
|
||||
return filePaths;
|
||||
const QStringList managedFilePaths
|
||||
= transform(proc.stdOut().split('\0', Qt::SkipEmptyParts),
|
||||
@@ -1427,7 +1427,7 @@ void GitClient::recoverDeletedFiles(const QString &workingDirectory)
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, {"ls-files", "--deleted"},
|
||||
VcsCommand::SuppressCommandLogging);
|
||||
if (proc.result() == QtcProcess::Finished) {
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
const QString stdOut = proc.stdOut().trimmed();
|
||||
if (stdOut.isEmpty()) {
|
||||
VcsOutputWindow::appendError(tr("Nothing to recover"));
|
||||
@@ -1454,7 +1454,7 @@ bool GitClient::synchronousLog(const QString &workingDirectory, const QStringLis
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, allArguments, flags, vcsTimeoutS(),
|
||||
encoding(workingDirectory, "i18n.logOutputEncoding"));
|
||||
if (proc.result() == QtcProcess::Finished) {
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
*output = proc.stdOut();
|
||||
return true;
|
||||
} else {
|
||||
@@ -1472,7 +1472,7 @@ bool GitClient::synchronousAdd(const QString &workingDirectory,
|
||||
args += extraOptions + files;
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, args);
|
||||
return proc.result() == QtcProcess::Finished;
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
bool GitClient::synchronousDelete(const QString &workingDirectory,
|
||||
@@ -1485,7 +1485,7 @@ bool GitClient::synchronousDelete(const QString &workingDirectory,
|
||||
arguments.append(files);
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments);
|
||||
return proc.result() == QtcProcess::Finished;
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
bool GitClient::synchronousMove(const QString &workingDirectory,
|
||||
@@ -1494,7 +1494,7 @@ bool GitClient::synchronousMove(const QString &workingDirectory,
|
||||
{
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, {"mv", from, to});
|
||||
return proc.result() == QtcProcess::Finished;
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
bool GitClient::synchronousReset(const QString &workingDirectory,
|
||||
@@ -1514,7 +1514,7 @@ bool GitClient::synchronousReset(const QString &workingDirectory,
|
||||
// Note that git exits with 1 even if the operation is successful
|
||||
// Assume real failure if the output does not contain "foo.cpp modified"
|
||||
// or "Unstaged changes after reset" (git 1.7.0).
|
||||
if (proc.result() != QtcProcess::Finished
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess
|
||||
&& (!stdOut.contains("modified") && !stdOut.contains("Unstaged changes after reset"))) {
|
||||
if (files.isEmpty()) {
|
||||
msgCannotRun(arguments, workingDirectory, proc.stdErr(), errorMessage);
|
||||
@@ -1535,7 +1535,7 @@ bool GitClient::synchronousInit(const QString &workingDirectory)
|
||||
vcsFullySynchronousExec(proc, workingDirectory, QStringList{"init"});
|
||||
// '[Re]Initialized...'
|
||||
VcsOutputWindow::append(proc.stdOut());
|
||||
if (proc.result() == QtcProcess::Finished) {
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
resetCachedVcsInfo(workingDirectory);
|
||||
return true;
|
||||
} else {
|
||||
@@ -1561,7 +1561,7 @@ bool GitClient::synchronousCheckoutFiles(const QString &workingDirectory, QStrin
|
||||
arguments << "--" << files;
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, VcsCommand::ExpectRepoChanges);
|
||||
if (proc.result() != QtcProcess::Finished) {
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
const QString fileArg = files.join(", ");
|
||||
//: Meaning of the arguments: %1: revision, %2: files, %3: repository,
|
||||
//: %4: Error message
|
||||
@@ -1612,7 +1612,7 @@ bool GitClient::synchronousRevListCmd(const QString &workingDirectory, const QSt
|
||||
const QStringList arguments = QStringList({"rev-list", noColorOption}) + extraArguments;
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags);
|
||||
if (proc.result() != QtcProcess::Finished) {
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
msgCannotRun(arguments, workingDirectory, proc.stdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
@@ -1676,7 +1676,7 @@ QString GitClient::synchronousCurrentLocalBranch(const QString &workingDirectory
|
||||
QString branch;
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, {"symbolic-ref", HEAD}, silentFlags);
|
||||
if (proc.result() == QtcProcess::Finished) {
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
branch = proc.stdOut().trimmed();
|
||||
} else {
|
||||
const QString gitDir = findGitDirForRepository(workingDirectory);
|
||||
@@ -1701,7 +1701,7 @@ bool GitClient::synchronousHeadRefs(const QString &workingDirectory, QStringList
|
||||
const QStringList arguments = {"show-ref", "--head", "--abbrev=10", "--dereference"};
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags);
|
||||
if (proc.result() != QtcProcess::Finished) {
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
msgCannotRun(arguments, workingDirectory, proc.stdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
@@ -1750,7 +1750,7 @@ QString GitClient::synchronousTopic(const QString &workingDirectory) const
|
||||
// No tag or remote branch - try git describe
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, QStringList{"describe"}, VcsCommand::NoOutput);
|
||||
if (proc.result() == QtcProcess::Finished) {
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
const QString stdOut = proc.stdOut().trimmed();
|
||||
if (!stdOut.isEmpty())
|
||||
return stdOut;
|
||||
@@ -1765,7 +1765,7 @@ bool GitClient::synchronousRevParseCmd(const QString &workingDirectory, const QS
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags);
|
||||
*output = proc.stdOut().trimmed();
|
||||
if (proc.result() != QtcProcess::Finished) {
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
msgCannotRun(arguments, workingDirectory, proc.stdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
@@ -1779,7 +1779,7 @@ QString GitClient::synchronousTopRevision(const QString &workingDirectory, QDate
|
||||
const QStringList arguments = {"show", "-s", "--pretty=format:%H:%ct", HEAD};
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags);
|
||||
if (proc.result() != QtcProcess::Finished)
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess)
|
||||
return QString();
|
||||
const QStringList output = proc.stdOut().trimmed().split(':');
|
||||
if (dateTime && output.size() > 1) {
|
||||
@@ -1841,7 +1841,7 @@ QString GitClient::synchronousShortDescription(const QString &workingDirectory,
|
||||
"--max-count=1", revision};
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags);
|
||||
if (proc.result() != QtcProcess::Finished) {
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
VcsOutputWindow::appendSilently(tr("Cannot describe revision \"%1\" in \"%2\": %3")
|
||||
.arg(revision, workingDirectory, proc.stdErr()));
|
||||
return revision;
|
||||
@@ -1922,7 +1922,7 @@ bool GitClient::executeSynchronousStash(const QString &workingDirectory,
|
||||
| VcsCommand::ShowSuccessMessage;
|
||||
SynchronousProcess proc;
|
||||
vcsSynchronousExec(proc, workingDirectory, arguments, flags);
|
||||
if (proc.result() != QtcProcess::Finished) {
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
msgCannotRun(arguments, workingDirectory, proc.stdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
@@ -1963,7 +1963,7 @@ bool GitClient::synchronousBranchCmd(const QString &workingDirectory, QStringLis
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, branchArgs);
|
||||
*output = proc.stdOut();
|
||||
if (proc.result() != QtcProcess::Finished) {
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
msgCannotRun(branchArgs, workingDirectory, proc.stdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
@@ -1977,7 +1977,7 @@ bool GitClient::synchronousTagCmd(const QString &workingDirectory, QStringList t
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, tagArgs);
|
||||
*output = proc.stdOut();
|
||||
if (proc.result() != QtcProcess::Finished) {
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
msgCannotRun(tagArgs, workingDirectory, proc.stdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
@@ -1991,7 +1991,7 @@ bool GitClient::synchronousForEachRefCmd(const QString &workingDirectory, QStrin
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, args, silentFlags);
|
||||
*output = proc.stdOut();
|
||||
if (proc.result() != QtcProcess::Finished) {
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
msgCannotRun(args, workingDirectory, proc.stdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
@@ -2015,7 +2015,7 @@ bool GitClient::synchronousRemoteCmd(const QString &workingDirectory, QStringLis
|
||||
*errorMessage = stdErr;
|
||||
*output = proc.stdOut();
|
||||
|
||||
if (proc.result() != QtcProcess::Finished) {
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
msgCannotRun(remoteArgs, workingDirectory, stdErr, errorMessage);
|
||||
return false;
|
||||
}
|
||||
@@ -2055,7 +2055,7 @@ QStringList GitClient::synchronousSubmoduleStatus(const QString &workingDirector
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, {"submodule", "status"}, silentFlags);
|
||||
|
||||
if (proc.result() != QtcProcess::Finished) {
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
msgCannotRun(tr("Cannot retrieve submodule status of \"%1\": %2")
|
||||
.arg(QDir::toNativeSeparators(workingDirectory), proc.stdErr()), errorMessage);
|
||||
return QStringList();
|
||||
@@ -2135,7 +2135,7 @@ QByteArray GitClient::synchronousShow(const QString &workingDirectory, const QSt
|
||||
const QStringList arguments = {"show", decorateOption, noColorOption, "--no-patch", id};
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, flags);
|
||||
if (proc.result() != QtcProcess::Finished) {
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
msgCannotRun(arguments, workingDirectory, proc.stdErr(), nullptr);
|
||||
return {};
|
||||
}
|
||||
@@ -2151,7 +2151,7 @@ bool GitClient::cleanList(const QString &workingDirectory, const QString &module
|
||||
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, directory, arguments, VcsCommand::ForceCLocale);
|
||||
if (proc.result() != QtcProcess::Finished) {
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
msgCannotRun(arguments, directory, proc.stdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
@@ -2199,7 +2199,7 @@ bool GitClient::synchronousApplyPatch(const QString &workingDirectory,
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments);
|
||||
const QString stdErr = proc.stdErr();
|
||||
if (proc.result() == QtcProcess::Finished) {
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
if (!stdErr.isEmpty())
|
||||
*errorMessage = tr("There were warnings while applying \"%1\" to \"%2\":\n%3")
|
||||
.arg(file, workingDirectory, stdErr);
|
||||
@@ -2332,7 +2332,7 @@ GitClient::StatusResult GitClient::gitStatus(const QString &workingDirectory, St
|
||||
if (output)
|
||||
*output = stdOut;
|
||||
|
||||
const bool statusRc = proc.result() == QtcProcess::Finished;
|
||||
const bool statusRc = proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
const bool branchKnown = !stdOut.startsWith("## HEAD (no branch)\n");
|
||||
// Is it something really fatal?
|
||||
if (!statusRc && !branchKnown) {
|
||||
@@ -2711,7 +2711,7 @@ bool GitClient::readDataFromCommit(const QString &repoDirectory, const QString &
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, repoDirectory, arguments, silentFlags);
|
||||
|
||||
if (proc.result() != QtcProcess::Finished) {
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
if (errorMessage) {
|
||||
*errorMessage = tr("Cannot retrieve last commit data of repository \"%1\".")
|
||||
.arg(QDir::toNativeSeparators(repoDirectory));
|
||||
@@ -2967,7 +2967,7 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory,
|
||||
|
||||
SynchronousProcess proc;
|
||||
vcsSynchronousExec(proc, repositoryDirectory, arguments, VcsCommand::NoFullySync);
|
||||
if (proc.result() == QtcProcess::Finished) {
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
VcsOutputWindow::appendMessage(msgCommitted(amendSHA1, commitCount));
|
||||
GitPlugin::updateCurrentBranch();
|
||||
return true;
|
||||
@@ -3108,7 +3108,7 @@ bool GitClient::executeAndHandleConflicts(const QString &workingDirectory,
|
||||
vcsSynchronousExec(proc, workingDirectory, arguments, flags);
|
||||
// Notify about changed files or abort the rebase.
|
||||
ConflictHandler::handleResponse(proc, workingDirectory, abortCommand);
|
||||
return proc.result() == QtcProcess::Finished;
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
void GitClient::pull(const QString &workingDirectory, bool rebase)
|
||||
@@ -3167,7 +3167,7 @@ bool GitClient::synchronousSetTrackingBranch(const QString &workingDirectory,
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc,
|
||||
workingDirectory, {"branch", "--set-upstream-to=" + tracking, branch});
|
||||
return proc.result() == QtcProcess::Finished;
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
VcsBase::VcsCommand *GitClient::asyncUpstreamStatus(const QString &workingDirectory,
|
||||
@@ -3490,7 +3490,7 @@ bool GitClient::synchronousStashRemove(const QString &workingDirectory, const QS
|
||||
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments);
|
||||
if (proc.result() == QtcProcess::Finished) {
|
||||
if (proc.result() == QtcProcess::FinishedWithSuccess) {
|
||||
const QString output = proc.stdOut();
|
||||
if (!output.isEmpty())
|
||||
VcsOutputWindow::append(output);
|
||||
@@ -3509,7 +3509,7 @@ bool GitClient::synchronousStashList(const QString &workingDirectory, QList<Stas
|
||||
const QStringList arguments = {"stash", "list", noColorOption};
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, VcsCommand::ForceCLocale);
|
||||
if (proc.result() != QtcProcess::Finished) {
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
msgCannotRun(arguments, workingDirectory, proc.stdErr(), errorMessage);
|
||||
return false;
|
||||
}
|
||||
@@ -3549,7 +3549,7 @@ QString GitClient::readOneLine(const QString &workingDirectory, const QStringLis
|
||||
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, arguments, silentFlags, vcsTimeoutS(), codec);
|
||||
if (proc.result() != QtcProcess::Finished)
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess)
|
||||
return QString();
|
||||
return proc.stdOut().trimmed();
|
||||
}
|
||||
@@ -3576,7 +3576,7 @@ unsigned GitClient::synchronousGitVersion(QString *errorMessage) const
|
||||
// run git --version
|
||||
SynchronousProcess proc;
|
||||
vcsSynchronousExec(proc, QString(), {"--version"}, silentFlags);
|
||||
if (proc.result() != QtcProcess::Finished) {
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess) {
|
||||
msgCannotRun(tr("Cannot determine Git version: %1").arg(proc.stdErr()), errorMessage);
|
||||
return 0;
|
||||
}
|
||||
|
@@ -203,8 +203,8 @@ public:
|
||||
case QtcProcess::Hang:
|
||||
m_fi.reportCanceled();
|
||||
break;
|
||||
case QtcProcess::Finished:
|
||||
case QtcProcess::FinishedError:
|
||||
case QtcProcess::FinishedWithSuccess:
|
||||
case QtcProcess::FinishedWithError:
|
||||
// When no results are found, git-grep exits with non-zero status.
|
||||
// Do not consider this as an error.
|
||||
break;
|
||||
|
@@ -237,7 +237,7 @@ static QByteArray decodeProvisioningProfile(const QString &path)
|
||||
// path is assumed to be valid file path to .mobileprovision
|
||||
p.setCommand({"openssl", {"smime", "-inform", "der", "-verify", "-in", path}});
|
||||
p.runBlocking();
|
||||
if (p.result() != Utils::QtcProcess::Finished)
|
||||
if (p.result() != Utils::QtcProcess::FinishedWithSuccess)
|
||||
qCDebug(iosCommonLog) << "Reading signed provisioning file failed" << path;
|
||||
return p.stdOut().toLatin1();
|
||||
}
|
||||
|
@@ -70,7 +70,7 @@ void XcodeProbe::detectDeveloperPaths()
|
||||
selectedXcode.setCommand({"/usr/bin/xcode-select", {"--print-path"}});
|
||||
selectedXcode.setProcessUserEventWhileRunning();
|
||||
selectedXcode.runBlocking();
|
||||
if (selectedXcode.result() != QtcProcess::Finished)
|
||||
if (selectedXcode.result() != QtcProcess::FinishedWithSuccess)
|
||||
qCWarning(probeLog)
|
||||
<< QString::fromLatin1("Could not detect selected Xcode using xcode-select");
|
||||
else
|
||||
|
@@ -89,7 +89,7 @@ static bool runCommand(const CommandLine &command, QString *stdOutput, QString *
|
||||
*stdOutput = p.stdOut();
|
||||
if (allOutput)
|
||||
*allOutput = p.allOutput();
|
||||
return p.result() == QtcProcess::Finished;
|
||||
return p.result() == QtcProcess::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
static bool runSimCtlCommand(QStringList args, QString *output, QString *allOutput = nullptr)
|
||||
|
@@ -129,7 +129,7 @@ bool MercurialClient::synchronousClone(const QString &workingDir,
|
||||
QStringList arguments(QLatin1String("init"));
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory.path(), arguments);
|
||||
if (proc.result() != QtcProcess::Finished)
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess)
|
||||
return false;
|
||||
|
||||
// Then pull remote repository
|
||||
@@ -137,7 +137,7 @@ bool MercurialClient::synchronousClone(const QString &workingDir,
|
||||
arguments << QLatin1String("pull") << dstLocation;
|
||||
SynchronousProcess proc1;
|
||||
vcsSynchronousExec(proc1, workingDirectory.path(), arguments, flags);
|
||||
if (proc1.result() != QtcProcess::Finished)
|
||||
if (proc1.result() != QtcProcess::FinishedWithSuccess)
|
||||
return false;
|
||||
|
||||
// By now, there is no hgrc file -> create it
|
||||
@@ -154,14 +154,14 @@ bool MercurialClient::synchronousClone(const QString &workingDir,
|
||||
arguments << QLatin1String("update");
|
||||
SynchronousProcess proc2;
|
||||
vcsSynchronousExec(proc2, workingDirectory.path(), arguments, flags);
|
||||
return proc2.result() == QtcProcess::Finished;
|
||||
return proc2.result() == QtcProcess::FinishedWithSuccess;
|
||||
} else {
|
||||
QStringList arguments(QLatin1String("clone"));
|
||||
arguments << dstLocation << workingDirectory.dirName();
|
||||
workingDirectory.cdUp();
|
||||
SynchronousProcess proc;
|
||||
vcsSynchronousExec(proc, workingDirectory.path(), arguments, flags);
|
||||
return proc.result() == QtcProcess::Finished;
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ bool MercurialClient::synchronousPull(const QString &workingDir, const QString &
|
||||
command.addFlags(flags);
|
||||
command.runCommand(proc, {vcsBinary(), args});
|
||||
|
||||
const bool ok = proc.result() == QtcProcess::Finished;
|
||||
const bool ok = proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
|
||||
parsePullOutput(proc.stdOut().trimmed());
|
||||
return ok;
|
||||
@@ -226,7 +226,7 @@ QStringList MercurialClient::parentRevisionsSync(const QString &workingDirectory
|
||||
args << file;
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, args);
|
||||
if (proc.result() != QtcProcess::Finished)
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess)
|
||||
return QStringList();
|
||||
/* Looks like: \code
|
||||
changeset: 0:031a48610fba
|
||||
@@ -269,7 +269,7 @@ QString MercurialClient::shortDescriptionSync(const QString &workingDirectory,
|
||||
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, args);
|
||||
if (proc.result() != QtcProcess::Finished)
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess)
|
||||
return revision;
|
||||
return stripLastNewline(proc.stdOut());
|
||||
}
|
||||
|
@@ -1282,10 +1282,10 @@ PerforceResponse PerforcePluginPrivate::synchronousProcess(const QString &workin
|
||||
response.stdErr = process.stdErr();
|
||||
response.stdOut = process.stdOut();
|
||||
switch (process.result()) {
|
||||
case QtcProcess::Finished:
|
||||
case QtcProcess::FinishedWithSuccess:
|
||||
response.error = false;
|
||||
break;
|
||||
case QtcProcess::FinishedError:
|
||||
case QtcProcess::FinishedWithError:
|
||||
response.message = msgExitCode(process.exitCode());
|
||||
response.error = !(flags & IgnoreExitCode);
|
||||
break;
|
||||
|
@@ -115,7 +115,7 @@ static bool
|
||||
process.setCommand(cmd);
|
||||
process.setProcessUserEventWhileRunning();
|
||||
process.runBlocking();
|
||||
if (process.result() != Utils::QtcProcess::Finished) {
|
||||
if (process.result() != Utils::QtcProcess::FinishedWithSuccess) {
|
||||
*errorMessage = QString("Generator script failed: %1").arg(process.exitMessage());
|
||||
const QString stdErr = process.stdErr();
|
||||
if (!stdErr.isEmpty()) {
|
||||
|
@@ -89,7 +89,7 @@ static QByteArray runGcc(const FilePath &gcc, const QStringList &arguments, cons
|
||||
cpp.setTimeoutS(10);
|
||||
cpp.setCommand({gcc, arguments});
|
||||
cpp.runBlocking();
|
||||
if (cpp.result() != QtcProcess::Finished || cpp.exitCode() != 0) {
|
||||
if (cpp.result() != QtcProcess::FinishedWithSuccess || cpp.exitCode() != 0) {
|
||||
Core::MessageManager::writeFlashing({"Compiler feature detection failure!",
|
||||
cpp.exitMessage(),
|
||||
QString::fromUtf8(cpp.allRawOutput())});
|
||||
|
@@ -245,12 +245,12 @@ static QVector<VisualStudioInstallation> detectVisualStudioFromVsWhere(const QSt
|
||||
{"-products", "*", "-prerelease", "-legacy", "-format", "json", "-utf8"}});
|
||||
vsWhereProcess.runBlocking();
|
||||
switch (vsWhereProcess.result()) {
|
||||
case QtcProcess::Finished:
|
||||
case QtcProcess::FinishedWithSuccess:
|
||||
break;
|
||||
case QtcProcess::StartFailed:
|
||||
qWarning().noquote() << QDir::toNativeSeparators(vswhere) << "could not be started.";
|
||||
return installations;
|
||||
case QtcProcess::FinishedError:
|
||||
case QtcProcess::FinishedWithError:
|
||||
qWarning().noquote().nospace() << QDir::toNativeSeparators(vswhere)
|
||||
<< " finished with exit code "
|
||||
<< vsWhereProcess.exitCode() << ".";
|
||||
@@ -630,7 +630,7 @@ Macros MsvcToolChain::msvcPredefinedMacros(const QStringList &cxxflags,
|
||||
arguments << toProcess << QLatin1String("/EP") << saver.filePath().toUserOutput();
|
||||
cpp.setCommand({binary, arguments});
|
||||
cpp.runBlocking();
|
||||
if (cpp.result() != QtcProcess::Finished || cpp.exitCode() != 0)
|
||||
if (cpp.result() != QtcProcess::FinishedWithSuccess || cpp.exitCode() != 0)
|
||||
return predefinedMacros;
|
||||
|
||||
const QStringList output = Utils::filtered(cpp.stdOut().split('\n'),
|
||||
@@ -1506,7 +1506,7 @@ static QVersionNumber clangClVersion(const QString &clangClPath)
|
||||
SynchronousProcess clangClProcess;
|
||||
clangClProcess.setCommand({clangClPath, {"--version"}});
|
||||
clangClProcess.runBlocking();
|
||||
if (clangClProcess.result() != QtcProcess::Finished || clangClProcess.exitCode() != 0)
|
||||
if (clangClProcess.result() != QtcProcess::FinishedWithSuccess || clangClProcess.exitCode() != 0)
|
||||
return {};
|
||||
const QRegularExpressionMatch match = QRegularExpression(
|
||||
QStringLiteral("clang version (\\d+(\\.\\d+)+)"))
|
||||
@@ -1732,7 +1732,7 @@ Macros ClangClToolChain::msvcPredefinedMacros(const QStringList &cxxflags,
|
||||
arguments.append("-");
|
||||
cpp.setCommand({compilerCommand(), arguments});
|
||||
cpp.runBlocking();
|
||||
if (cpp.result() != Utils::QtcProcess::Finished || cpp.exitCode() != 0) {
|
||||
if (cpp.result() != Utils::QtcProcess::FinishedWithSuccess || cpp.exitCode() != 0) {
|
||||
// Show the warning but still parse the output.
|
||||
QTC_CHECK(false && "clang-cl exited with non-zero code.");
|
||||
}
|
||||
@@ -2076,7 +2076,7 @@ Utils::optional<QString> MsvcToolChain::generateEnvironmentSettings(const Utils:
|
||||
run.setCommand(cmd);
|
||||
run.runBlocking();
|
||||
|
||||
if (run.result() != QtcProcess::Finished) {
|
||||
if (run.result() != QtcProcess::FinishedWithSuccess) {
|
||||
const QString message = !run.stdErr().isEmpty() ? run.stdErr() : run.exitMessage();
|
||||
qWarning().noquote() << message;
|
||||
QString command = QDir::toNativeSeparators(batchFile);
|
||||
|
@@ -283,7 +283,7 @@ Interpreter::Interpreter(const FilePath &python, const QString &defaultName, boo
|
||||
pythonProcess.setTimeoutS(1);
|
||||
pythonProcess.setCommand({python, {"--version"}});
|
||||
pythonProcess.runBlocking();
|
||||
if (pythonProcess.result() == QtcProcess::Finished)
|
||||
if (pythonProcess.result() == QtcProcess::FinishedWithSuccess)
|
||||
name = pythonProcess.stdOut().trimmed();
|
||||
if (name.isEmpty())
|
||||
name = defaultName;
|
||||
|
@@ -88,7 +88,7 @@ static QString pythonName(const FilePath &pythonPath)
|
||||
pythonProcess.setTimeoutS(2);
|
||||
pythonProcess.setCommand({pythonPath, {"--version"}});
|
||||
pythonProcess.runBlocking();
|
||||
if (pythonProcess.result() != QtcProcess::Finished)
|
||||
if (pythonProcess.result() != QtcProcess::FinishedWithSuccess)
|
||||
return {};
|
||||
name = pythonProcess.allOutput().trimmed();
|
||||
nameForPython[pythonPath] = name;
|
||||
|
@@ -94,7 +94,7 @@ bool SubversionClient::doCommit(const QString &repositoryRoot,
|
||||
SynchronousProcess proc;
|
||||
vcsSynchronousExec(proc, repositoryRoot, args << svnExtraOptions << escapeFiles(files),
|
||||
VcsCommand::ShowStdOut | VcsCommand::NoFullySync);
|
||||
return proc.result() == QtcProcess::Finished;
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
void SubversionClient::commit(const QString &repositoryRoot,
|
||||
@@ -153,7 +153,7 @@ QString SubversionClient::synchronousTopic(const QString &repository) const
|
||||
svnVersionBinary.append(HostOsInfo::withExecutableSuffix("svnversion"));
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, repository, {svnVersionBinary, args});
|
||||
if (proc.result() != QtcProcess::Finished)
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess)
|
||||
return QString();
|
||||
|
||||
return proc.stdOut().trimmed();
|
||||
|
@@ -1029,7 +1029,7 @@ SubversionResponse SubversionPluginPrivate::runSvn(const QString &workingDir,
|
||||
SynchronousProcess proc;
|
||||
m_client->vcsFullySynchronousExec(proc, workingDir, arguments, flags, timeOutS, outputCodec);
|
||||
|
||||
response.error = proc.result() != QtcProcess::Finished;
|
||||
response.error = proc.result() != QtcProcess::FinishedWithSuccess;
|
||||
if (response.error)
|
||||
response.message = proc.exitMessage();
|
||||
response.stdErr = proc.stdErr();
|
||||
|
@@ -92,7 +92,7 @@ static FormatTask format(FormatTask task)
|
||||
process.setTimeoutS(5);
|
||||
process.setCommand({executable, options});
|
||||
process.runBlocking();
|
||||
if (process.result() != QtcProcess::Finished) {
|
||||
if (process.result() != QtcProcess::FinishedWithSuccess) {
|
||||
task.error = QString(QT_TRANSLATE_NOOP("TextEditor", "Failed to format: %1."))
|
||||
.arg(process.exitMessage());
|
||||
return task;
|
||||
|
@@ -76,7 +76,7 @@ QString findFallbackDefinitionsLocation()
|
||||
process.setTimeoutS(5);
|
||||
process.setCommand({program, {"--prefix"}});
|
||||
process.runBlocking();
|
||||
if (process.result() == Utils::QtcProcess::Finished) {
|
||||
if (process.result() == Utils::QtcProcess::FinishedWithSuccess) {
|
||||
QString output = process.stdOut();
|
||||
output.remove(QLatin1Char('\n'));
|
||||
for (auto &kateSyntaxPath : kateSyntaxPaths) {
|
||||
|
@@ -138,7 +138,7 @@ void UpdateInfoPlugin::startCheckForUpdates()
|
||||
d->m_checkUpdatesCommand->addJob({Utils::FilePath::fromString(d->m_maintenanceTool), {"--checkupdates"}},
|
||||
60 * 3, // 3 minutes timeout
|
||||
/*workingDirectory=*/QString(),
|
||||
[](int /*exitCode*/) { return Utils::QtcProcess::Finished; });
|
||||
[](int /*exitCode*/) { return Utils::QtcProcess::FinishedWithSuccess; });
|
||||
d->m_checkUpdatesCommand->execute();
|
||||
d->m_progress = d->m_checkUpdatesCommand->futureProgress();
|
||||
if (d->m_progress) {
|
||||
|
@@ -271,7 +271,7 @@ bool VcsBaseClient::synchronousCreateRepository(const QString &workingDirectory,
|
||||
args << extraOptions;
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, args);
|
||||
if (proc.result() != QtcProcess::Finished)
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess)
|
||||
return false;
|
||||
VcsOutputWindow::append(proc.stdOut());
|
||||
|
||||
@@ -292,7 +292,7 @@ bool VcsBaseClient::synchronousClone(const QString &workingDir,
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDir, args);
|
||||
resetCachedVcsInfo(workingDir);
|
||||
return proc.result() == QtcProcess::Finished;
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
bool VcsBaseClient::synchronousAdd(const QString &workingDir, const QString &filename,
|
||||
@@ -302,7 +302,7 @@ bool VcsBaseClient::synchronousAdd(const QString &workingDir, const QString &fil
|
||||
args << vcsCommandString(AddCommand) << extraOptions << filename;
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDir, args);
|
||||
return proc.result() == QtcProcess::Finished;
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
bool VcsBaseClient::synchronousRemove(const QString &workingDir, const QString &filename,
|
||||
@@ -312,7 +312,7 @@ bool VcsBaseClient::synchronousRemove(const QString &workingDir, const QString &
|
||||
args << vcsCommandString(RemoveCommand) << extraOptions << filename;
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDir, args);
|
||||
return proc.result() == QtcProcess::Finished;
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
bool VcsBaseClient::synchronousMove(const QString &workingDir,
|
||||
@@ -323,7 +323,7 @@ bool VcsBaseClient::synchronousMove(const QString &workingDir,
|
||||
args << vcsCommandString(MoveCommand) << extraOptions << from << to;
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDir, args);
|
||||
return proc.result() == QtcProcess::Finished;
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
bool VcsBaseClient::synchronousPull(const QString &workingDir,
|
||||
@@ -339,7 +339,7 @@ bool VcsBaseClient::synchronousPull(const QString &workingDir,
|
||||
| VcsCommand::ShowSuccessMessage;
|
||||
SynchronousProcess proc;
|
||||
vcsSynchronousExec(proc, workingDir, args, flags);
|
||||
const bool ok = proc.result() == QtcProcess::Finished;
|
||||
const bool ok = proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
if (ok)
|
||||
emit changed(QVariant(workingDir));
|
||||
return ok;
|
||||
@@ -358,7 +358,7 @@ bool VcsBaseClient::synchronousPush(const QString &workingDir,
|
||||
| VcsCommand::ShowSuccessMessage;
|
||||
SynchronousProcess proc;
|
||||
vcsSynchronousExec(proc, workingDir, args, flags);
|
||||
return proc.result() == QtcProcess::Finished;
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
VcsBaseEditorWidget *VcsBaseClient::annotate(
|
||||
|
Reference in New Issue
Block a user