aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/bazaar
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2021-05-12 14:25:50 +0200
committerhjk <hjk@qt.io>2021-05-14 13:19:01 +0000
commit55f768e1b0a2f49977a48972b243d3efa255e337 (patch)
tree004b6e589d3589c2a11335f59b7a6e1380a859a7 /src/plugins/bazaar
parentf23b27ded6bc4f7859ff2091b957213fa4597fe9 (diff)
Utils: Make process results accessible through QtcProcess object
The result is fully stored in the object anyway. Using the extra SynchronousProcessResponse structure only causes copies of the data and complicates access on the user side in a lot of cases. The result bits are now also accessible individually. There's obvious room for follow-up changes on the topic, e.g. ShellCommand::runCommand's parameter list could shrink to just a SynchronousProcess parameter. Change-Id: I45aa7eb23832340be06905929280c012e1217263 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/bazaar')
-rw-r--r--src/plugins/bazaar/bazaarclient.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/plugins/bazaar/bazaarclient.cpp b/src/plugins/bazaar/bazaarclient.cpp
index d00a3961cf2..04e86c37aec 100644
--- a/src/plugins/bazaar/bazaarclient.cpp
+++ b/src/plugins/bazaar/bazaarclient.cpp
@@ -150,9 +150,10 @@ bool BazaarClient::synchronousUncommit(const QString &workingDir,
<< revisionSpec(revision)
<< extraOptions;
- const SynchronousProcessResponse result = vcsFullySynchronousExec(workingDir, args);
- VcsOutputWindow::append(result.stdOut());
- return result.result == SynchronousProcessResponse::Finished;
+ SynchronousProcess proc;
+ vcsFullySynchronousExec(proc, workingDir, args);
+ VcsOutputWindow::append(proc.stdOut());
+ return proc.result() == QtcProcess::Finished;
}
void BazaarClient::commit(const QString &repositoryRoot, const QStringList &files,
@@ -190,10 +191,11 @@ bool BazaarClient::managesFile(const QString &workingDirectory, const QString &f
QStringList args(QLatin1String("status"));
args << fileName;
- const SynchronousProcessResponse result = vcsFullySynchronousExec(workingDirectory, args);
- if (result.result != SynchronousProcessResponse::Finished)
+ SynchronousProcess proc;
+ vcsFullySynchronousExec(proc, workingDirectory, args);
+ if (proc.result() != QtcProcess::Finished)
return false;
- return result.rawStdOut.startsWith("unknown");
+ return proc.rawStdOut().startsWith("unknown");
}
void BazaarClient::view(const QString &source, const QString &id, const QStringList &extraOptions)
@@ -231,8 +233,8 @@ ExitCodeInterpreter BazaarClient::exitCodeInterpreter(VcsCommandTag cmd) const
{
if (cmd == DiffCommand) {
return [](int code) {
- return (code < 0 || code > 2) ? SynchronousProcessResponse::FinishedError
- : SynchronousProcessResponse::Finished;
+ return (code < 0 || code > 2) ? QtcProcess::FinishedError
+ : QtcProcess::Finished;
};
}
return {};