Vcs: Push the binary into the Jobs of VcsCommand

This is the first step to generalizing the class for wider use.

Change-Id: I40ccb5bec4fdcb9d0a67388160c867799331007b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Tobias Hunger
2015-04-15 16:09:56 +02:00
parent 6a9bd957cb
commit c7c785ace3
11 changed files with 66 additions and 85 deletions

View File

@@ -123,10 +123,9 @@ VcsCommand *CloneWizardPage::createCheckoutJob(Utils::FileName *checkoutPath) co
if (d->recursiveCheckBox->isChecked())
args << QLatin1String("--recursive");
args << QLatin1String("--progress") << repository() << checkoutDir;
auto command = new VcsCommand(client->vcsBinary(), workingDirectory,
client->processEnvironment());
auto command = new VcsCommand(workingDirectory, client->processEnvironment());
command->addFlags(VcsBasePlugin::MergeOutputChannels);
command->addJob(args, -1);
command->addJob(client->vcsBinary(), args, -1);
return command;
}

View File

@@ -150,7 +150,7 @@ void BaseController::runCommand(const QList<QStringList> &args, QTextCodec *code
m_command->cancel();
}
m_command = new VcsCommand(gitClient()->vcsBinary(), m_directory, gitClient()->processEnvironment());
m_command = new VcsCommand(m_directory, gitClient()->processEnvironment());
m_command->setCodec(codec ? codec : EditorManager::defaultTextCodec());
connect(m_command, &VcsCommand::output, this, &BaseController::processOutput);
connect(m_command, &VcsCommand::finished, this, &BaseController::reloadFinished);
@@ -159,7 +159,7 @@ void BaseController::runCommand(const QList<QStringList> &args, QTextCodec *code
foreach (const QStringList &arg, args) {
QTC_ASSERT(!arg.isEmpty(), continue);
m_command->addJob(arg, gitClient()->vcsTimeoutS());
m_command->addJob(gitClient()->vcsBinary(), arg, gitClient()->vcsTimeoutS());
}
m_command->execute();