VCS: Use runVcs for Command

* Removes duplication
* Supports all flags accepted by runVcs
* Supports output while running

Change-Id: Id067791760753184cd2516c23634564880ca5db0
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Orgad Shaneh
2013-08-13 08:37:27 +03:00
committed by Orgad Shaneh
parent cc2610aa71
commit f9c4889a7f
5 changed files with 39 additions and 94 deletions

View File

@@ -596,27 +596,18 @@ Command *VcsBaseClient::createCommand(const QString &workingDirectory,
if (editor)
d->bindCommandToEditor(cmd, editor);
if (mode == VcsWindowOutputBind) {
if (editor) { // assume that the commands output is the important thing
connect(cmd, SIGNAL(output(QString)),
::vcsOutputWindow(), SLOT(appendSilently(QString)));
} else {
connect(cmd, SIGNAL(output(QString)),
::vcsOutputWindow(), SLOT(append(QString)));
}
cmd->addFlags(VcsBasePlugin::ShowStdOutInLogWindow);
if (editor) // assume that the commands output is the important thing
cmd->addFlags(VcsBasePlugin::SilentOutput);
} else if (editor) {
connect(cmd, SIGNAL(output(QString)), editor, SLOT(setPlainText(QString)));
}
if (::vcsOutputWindow())
connect(cmd, SIGNAL(errorText(QString)),
::vcsOutputWindow(), SLOT(appendError(QString)));
return cmd;
}
void VcsBaseClient::enqueueJob(Command *cmd, const QStringList &args)
{
const QString binary = QFileInfo(d->m_clientSettings->binaryPath()).baseName();
::vcsOutputWindow()->appendCommand(cmd->workingDirectory(), binary, args);
cmd->addJob(args);
cmd->execute();
}