diff options
author | hjk <[email protected]> | 2021-05-12 14:25:50 +0200 |
---|---|---|
committer | hjk <[email protected]> | 2021-05-14 13:19:01 +0000 |
commit | 55f768e1b0a2f49977a48972b243d3efa255e337 (patch) | |
tree | 004b6e589d3589c2a11335f59b7a6e1380a859a7 /src/plugins/baremetal/keiltoolchain.cpp | |
parent | f23b27ded6bc4f7859ff2091b957213fa4597fe9 (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 <[email protected]>
Diffstat (limited to 'src/plugins/baremetal/keiltoolchain.cpp')
-rw-r--r-- | src/plugins/baremetal/keiltoolchain.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/plugins/baremetal/keiltoolchain.cpp b/src/plugins/baremetal/keiltoolchain.cpp index 9fc8643a0c0..a88a7c103d6 100644 --- a/src/plugins/baremetal/keiltoolchain.cpp +++ b/src/plugins/baremetal/keiltoolchain.cpp @@ -140,8 +140,8 @@ static Macros dumpMcsPredefinedMacros(const FilePath &compiler, const Environmen cpp.setTimeoutS(10); const CommandLine cmd(compiler, {fakeIn.fileName()}); - const SynchronousProcessResponse response = cpp.runBlocking(cmd); - QString output = response.allOutput(); + cpp.runBlocking(cmd); + QString output = cpp.allOutput(); Macros macros; QTextStream stream(&output); QString line; @@ -269,8 +269,8 @@ static Macros dumpC166PredefinedMacros(const FilePath &compiler, const Environme }; const CommandLine cmd(compiler, {fakeIn.fileName()}); - const SynchronousProcessResponse response = cpp.runBlocking(cmd); - const QString output = response.allOutput(); + cpp.runBlocking(cmd); + const QString output = cpp.allOutput(); extractMacros(output); return macros; } @@ -286,14 +286,13 @@ static Macros dumpArmPredefinedMacros(const FilePath &compiler, const QStringLis args.push_back("--list-macros"); const CommandLine cmd(compiler, args); - const SynchronousProcessResponse response = cpp.runBlocking(cmd); - if (response.result != SynchronousProcessResponse::Finished - || response.exitCode != 0) { - qWarning() << response.exitMessage(compiler.toString(), 10); + cpp.runBlocking(cmd); + if (cpp.result() != QtcProcess::Finished || cpp.exitCode() != 0) { + qWarning() << cpp.exitMessage(compiler.toString(), 10); return {}; } - const QByteArray output = response.allOutput().toUtf8(); + const QByteArray output = cpp.allOutput().toUtf8(); return Macro::toMacros(output); } |