forked from qt-creator/qt-creator
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:
@@ -162,7 +162,8 @@ void VcsBaseClientImpl::vcsFullySynchronousExec(SynchronousProcess &proc,
|
||||
command.addFlags(flags);
|
||||
if (codec)
|
||||
command.setCodec(codec);
|
||||
command.runCommand(proc, cmdLine, (timeoutS > 0) ? timeoutS : vcsTimeoutS());
|
||||
proc.setTimeoutS(timeoutS > 0 ? timeoutS : vcsTimeoutS());
|
||||
command.runCommand(proc, cmdLine);
|
||||
}
|
||||
|
||||
void VcsBaseClientImpl::resetCachedVcsInfo(const QString &workingDir)
|
||||
@@ -211,9 +212,10 @@ void VcsBaseClientImpl::vcsSynchronousExec(SynchronousProcess &proc, const QStri
|
||||
{
|
||||
Environment env = processEnvironment();
|
||||
VcsCommand command(workingDir, env.size() == 0 ? Environment::systemEnvironment() : env);
|
||||
proc.setTimeoutS(vcsTimeoutS());
|
||||
command.addFlags(flags);
|
||||
command.setCodec(outputCodec);
|
||||
command.runCommand(proc, {vcsBinary(), args}, vcsTimeoutS());
|
||||
command.runCommand(proc, {vcsBinary(), args});
|
||||
}
|
||||
|
||||
int VcsBaseClientImpl::vcsTimeoutS() const
|
||||
|
||||
@@ -78,11 +78,9 @@ const Environment VcsCommand::processEnvironment() const
|
||||
|
||||
void VcsCommand::runCommand(SynchronousProcess &proc,
|
||||
const CommandLine &command,
|
||||
int timeoutS,
|
||||
const QString &workingDirectory,
|
||||
const ExitCodeInterpreter &interpreter)
|
||||
const QString &workingDirectory)
|
||||
{
|
||||
ShellCommand::runCommand(proc, command, timeoutS, workingDirectory, interpreter);
|
||||
ShellCommand::runCommand(proc, command, workingDirectory);
|
||||
emitRepositoryChanged(workingDirectory);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,9 +47,7 @@ public:
|
||||
|
||||
void runCommand(Utils::SynchronousProcess &process,
|
||||
const Utils::CommandLine &command,
|
||||
int timeoutS,
|
||||
const QString &workDirectory = QString(),
|
||||
const Utils::ExitCodeInterpreter &interpreter = {}) override;
|
||||
const QString &workDirectory = {}) override;
|
||||
|
||||
private:
|
||||
void emitRepositoryChanged(const QString &workingDirectory);
|
||||
|
||||
Reference in New Issue
Block a user