aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/perforce
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/perforce
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/perforce')
-rw-r--r--src/plugins/perforce/perforceplugin.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp
index 411dfb576d5..a3b104bd7cd 100644
--- a/src/plugins/perforce/perforceplugin.cpp
+++ b/src/plugins/perforce/perforceplugin.cpp
@@ -1272,28 +1272,28 @@ PerforceResponse PerforcePluginPrivate::synchronousProcess(const QString &workin
process.setStdOutCallback([](const QString &lines) { VcsOutputWindow::append(lines); });
}
process.setTimeOutMessageBoxEnabled(true);
- const SynchronousProcessResponse sp_resp = process.run({m_settings.p4BinaryPath.value(), args});
+ process.run({m_settings.p4BinaryPath.value(), args});
PerforceResponse response;
response.error = true;
- response.exitCode = sp_resp.exitCode;
- response.stdErr = sp_resp.stdErr();
- response.stdOut = sp_resp.stdOut();
- switch (sp_resp.result) {
- case SynchronousProcessResponse::Finished:
+ response.exitCode = process.exitCode();
+ response.stdErr = process.stdErr();
+ response.stdOut = process.stdOut();
+ switch (process.result()) {
+ case QtcProcess::Finished:
response.error = false;
break;
- case SynchronousProcessResponse::FinishedError:
- response.message = msgExitCode(sp_resp.exitCode);
+ case QtcProcess::FinishedError:
+ response.message = msgExitCode(process.exitCode());
response.error = !(flags & IgnoreExitCode);
break;
- case SynchronousProcessResponse::TerminatedAbnormally:
+ case QtcProcess::TerminatedAbnormally:
response.message = msgCrash();
break;
- case SynchronousProcessResponse::StartFailed:
+ case QtcProcess::StartFailed:
response.message = msgNotStarted(m_settings.p4BinaryPath.value());
break;
- case SynchronousProcessResponse::Hang:
+ case QtcProcess::Hang:
response.message = msgCrash();
break;
}