ShellCommand: Introduce CommandResult structure

Don't require QtcProcess instance when calling
ShellCommand::runCommand().

Change-Id: Ie0287d91c1807465eab12be7eaa2eac561179af7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Jarek Kobus
2022-07-29 14:41:15 +02:00
parent 278f33d521
commit 0a1ac481ed
13 changed files with 354 additions and 397 deletions

View File

@@ -33,11 +33,11 @@
#include <vcsbase/vcsbaseconstants.h>
#include <utils/algorithm.h>
#include <utils/commandline.h>
#include <utils/fancylineedit.h>
#include <utils/filesearch.h>
#include <utils/fileutils.h>
#include <utils/qtcassert.h>
#include <utils/qtcprocess.h>
#include <utils/runextensions.h>
#include <utils/shellcommand.h>
#include <utils/textfileformat.h>
@@ -198,10 +198,8 @@ public:
QObject::connect(m_command.get(),
&ShellCommand::stdOutText,
[this, &fi](const QString &text) { read(fi, text); });
QtcProcess proc;
proc.setTimeoutS(0);
m_command->runCommand(proc, {m_vcsBinary, arguments});
switch (proc.result()) {
const CommandResult result = m_command->runCommand({m_vcsBinary, arguments}, {}, 0);
switch (result.result()) {
case ProcessResult::TerminatedAbnormally:
case ProcessResult::StartFailed:
case ProcessResult::Hang: