Vcs: Simplify VcsCommand::runCommand interface

The timeout and exit code interpreter properties are already
accessible via the SynchronousProcess parameter.

Change-Id: I1ba9c768a781009df65b5070a1d017c41d7e2663
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
hjk
2021-05-14 13:28:13 +02:00
parent b2dc771d80
commit 73c0175f4b
9 changed files with 21 additions and 24 deletions

View File

@@ -274,8 +274,9 @@ void ShellCommand::run(QFutureInterface<void> &future)
for (int j = 0; j < count; j++) {
const Internal::ShellCommandPrivate::Job &job = d->m_jobs.at(j);
SynchronousProcess proc;
runCommand(proc, job.command, job.timeoutS, job.workingDirectory,
job.exitCodeInterpreter);
proc.setExitCodeInterpreter(job.exitCodeInterpreter);
proc.setTimeoutS(job.timeoutS);
runCommand(proc, job.command, job.workingDirectory);
stdOut += proc.stdOut();
stdErr += proc.stdErr();
d->m_lastExecExitCode = proc.exitCode();
@@ -307,9 +308,8 @@ void ShellCommand::run(QFutureInterface<void> &future)
}
void ShellCommand::runCommand(SynchronousProcess &proc,
const CommandLine &command, int timeoutS,
const QString &workingDirectory,
const ExitCodeInterpreter &interpreter)
const CommandLine &command,
const QString &workingDirectory)
{
const QString dir = workDirectory(workingDirectory);
@@ -323,9 +323,6 @@ void ShellCommand::runCommand(SynchronousProcess &proc,
if (!(d->m_flags & SuppressCommandLogging))
emit proxy->appendCommand(dir, command);
proc.setTimeoutS(timeoutS);
proc.setExitCodeInterpreter(interpreter);
if ((d->m_flags & FullySynchronously)
|| (!(d->m_flags & NoFullySync)
&& QThread::currentThread() == QCoreApplication::instance()->thread())) {