VcsBase: More use of settings instead of client when it suffices

Client::vcsBinary() maps directly to Settings::binaryPath()
except for git can be replaced by that in non-generic settings.

Change-Id: I245659d3c423361e87c92e8995fa3476d798cc7b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
hjk
2020-02-03 17:54:41 +01:00
parent 481a00c298
commit 85d9756c00
4 changed files with 10 additions and 10 deletions

View File

@@ -850,7 +850,7 @@ bool BazaarPluginPrivate::managesFile(const QString &workingDirectory, const QSt
bool BazaarPluginPrivate::isConfigured() const bool BazaarPluginPrivate::isConfigured() const
{ {
const Utils::FilePath binary = m_client.vcsBinary(); const Utils::FilePath binary = m_settings.binaryPath();
if (binary.isEmpty()) if (binary.isEmpty())
return false; return false;
QFileInfo fi = binary.toFileInfo(); QFileInfo fi = binary.toFileInfo();

View File

@@ -375,7 +375,7 @@ bool CvsPluginPrivate::isVcsFileOrDirectory(const Utils::FilePath &fileName) con
bool CvsPluginPrivate::isConfigured() const bool CvsPluginPrivate::isConfigured() const
{ {
const Utils::FilePath binary = m_client->vcsBinary(); const Utils::FilePath binary = m_settings.binaryPath();
if (binary.isEmpty()) if (binary.isEmpty())
return false; return false;
QFileInfo fi = binary.toFileInfo(); QFileInfo fi = binary.toFileInfo();
@@ -454,7 +454,7 @@ Core::ShellCommand *CvsPluginPrivate::createInitialCheckoutCommand(const QString
auto command = new VcsBase::VcsCommand(baseDirectory.toString(), auto command = new VcsBase::VcsCommand(baseDirectory.toString(),
QProcessEnvironment::systemEnvironment()); QProcessEnvironment::systemEnvironment());
command->setDisplayName(tr("CVS Checkout")); command->setDisplayName(tr("CVS Checkout"));
command->addJob({m_client->vcsBinary(), m_settings.addOptions(args)}, -1); command->addJob({m_settings.binaryPath(), m_settings.addOptions(args)}, -1);
return command; return command;
} }
@@ -1413,7 +1413,7 @@ CvsResponse CvsPluginPrivate::runCvs(const QString &workingDirectory,
unsigned flags, unsigned flags,
QTextCodec *outputCodec) const QTextCodec *outputCodec) const
{ {
const FilePath executable = m_client->vcsBinary(); const FilePath executable = m_settings.binaryPath();
CvsResponse response; CvsResponse response;
if (executable.isEmpty()) { if (executable.isEmpty()) {
response.result = CvsResponse::OtherError; response.result = CvsResponse::OtherError;

View File

@@ -749,7 +749,7 @@ bool MercurialPluginPrivate::managesFile(const QString &workingDirectory, const
bool MercurialPluginPrivate::isConfigured() const bool MercurialPluginPrivate::isConfigured() const
{ {
const Utils::FilePath binary = m_client.vcsBinary(); const Utils::FilePath binary = m_settings.binaryPath();
if (binary.isEmpty()) if (binary.isEmpty())
return false; return false;
QFileInfo fi = binary.toFileInfo(); QFileInfo fi = binary.toFileInfo();
@@ -822,7 +822,7 @@ Core::ShellCommand *MercurialPluginPrivate::createInitialCheckoutCommand(const Q
args << QLatin1String("clone") << extraArgs << url << localName; args << QLatin1String("clone") << extraArgs << url << localName;
auto command = new VcsBase::VcsCommand(baseDirectory.toString(), auto command = new VcsBase::VcsCommand(baseDirectory.toString(),
m_client.processEnvironment()); m_client.processEnvironment());
command->addJob({m_client.vcsBinary(), args}, -1); command->addJob({m_settings.binaryPath(), args}, -1);
return command; return command;
} }

View File

@@ -1018,7 +1018,7 @@ SubversionResponse SubversionPluginPrivate::runSvn(const QString &workingDir,
QTextCodec *outputCodec) const QTextCodec *outputCodec) const
{ {
SubversionResponse response; SubversionResponse response;
if (m_client->vcsBinary().isEmpty()) { if (m_settings.binaryPath().isEmpty()) {
response.error = true; response.error = true;
response.message =tr("No subversion executable specified."); response.message =tr("No subversion executable specified.");
return response; return response;
@@ -1029,7 +1029,7 @@ SubversionResponse SubversionPluginPrivate::runSvn(const QString &workingDir,
response.error = sp_resp.result != SynchronousProcessResponse::Finished; response.error = sp_resp.result != SynchronousProcessResponse::Finished;
if (response.error) if (response.error)
response.message = sp_resp.exitMessage(m_client->vcsBinary().toString(), timeOutS); response.message = sp_resp.exitMessage(m_settings.binaryPath().toString(), timeOutS);
response.stdErr = sp_resp.stdErr(); response.stdErr = sp_resp.stdErr();
response.stdOut = sp_resp.stdOut(); response.stdOut = sp_resp.stdOut();
return response; return response;
@@ -1222,7 +1222,7 @@ bool SubversionPluginPrivate::isVcsFileOrDirectory(const Utils::FilePath &fileNa
bool SubversionPluginPrivate::isConfigured() const bool SubversionPluginPrivate::isConfigured() const
{ {
const Utils::FilePath binary = m_client->vcsBinary(); const Utils::FilePath binary = m_settings.binaryPath();
if (binary.isEmpty()) if (binary.isEmpty())
return false; return false;
QFileInfo fi = binary.toFileInfo(); QFileInfo fi = binary.toFileInfo();
@@ -1296,7 +1296,7 @@ Core::ShellCommand *SubversionPluginPrivate::createInitialCheckoutCommand(const
args << extraArgs << url << localName; args << extraArgs << url << localName;
auto command = new VcsBase::VcsCommand(baseDirectory.toString(), m_client->processEnvironment()); auto command = new VcsBase::VcsCommand(baseDirectory.toString(), m_client->processEnvironment());
command->addJob({m_client->vcsBinary(), args}, -1); command->addJob({m_settings.binaryPath(), args}, -1);
return command; return command;
} }