Commit 4f7844d6 authored by Tobias Hunger's avatar Tobias Hunger Committed by Orgad Shaneh
Browse files

Git: s/GitPlugin::gitClient/GitPlugin::client/



... same name as with almost all other plugins.

Change-Id: I964159044d86685735e8b1e816a0bf67e0576fd8
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent 90ce38da
......@@ -59,7 +59,7 @@ namespace Internal {
BranchDialog::BranchDialog(QWidget *parent) :
QDialog(parent),
m_ui(new Ui::BranchDialog),
m_model(new BranchModel(GitPlugin::instance()->gitClient(), this))
m_model(new BranchModel(GitPlugin::instance()->client(), this))
{
setModal(false);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
......@@ -197,7 +197,7 @@ void BranchDialog::checkout()
QLatin1Char(' ') + nextBranch + QLatin1String("-AutoStash ");
BranchCheckoutDialog branchCheckoutDialog(this, currentBranch, nextBranch);
GitClient *gitClient = GitPlugin::instance()->gitClient();
GitClient *gitClient = GitPlugin::instance()->client();
if (gitClient->gitStatus(m_repository, StatusMode(NoUntracked | NoSubmodules)) != GitClient::StatusChanged)
branchCheckoutDialog.foundNoLocalChanges();
......@@ -317,7 +317,7 @@ void BranchDialog::diff()
if (fullName.isEmpty())
return;
// Do not pass working dir by reference since it might change
GitPlugin::instance()->gitClient()->diffBranch(QString(m_repository), fullName);
GitPlugin::instance()->client()->diffBranch(QString(m_repository), fullName);
}
void BranchDialog::log()
......@@ -326,7 +326,7 @@ void BranchDialog::log()
if (branchName.isEmpty())
return;
// Do not pass working dir by reference since it might change
GitPlugin::instance()->gitClient()->log(QString(m_repository), QString(), false, QStringList(branchName));
GitPlugin::instance()->client()->log(QString(m_repository), QString(), false, QStringList(branchName));
}
void BranchDialog::reset()
......@@ -339,7 +339,7 @@ void BranchDialog::reset()
if (QMessageBox::question(this, tr("Git Reset"), tr("Hard reset branch \"%1\" to \"%2\"?")
.arg(currentName).arg(branchName),
QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) {
GitPlugin::instance()->gitClient()->reset(QString(m_repository), QLatin1String("--hard"),
GitPlugin::instance()->client()->reset(QString(m_repository), QLatin1String("--hard"),
branchName);
}
......@@ -353,7 +353,7 @@ void BranchDialog::merge()
QTC_CHECK(idx != m_model->currentBranch()); // otherwise the button would not be enabled!
const QString branch = m_model->fullName(idx, true);
GitClient *client = GitPlugin::instance()->gitClient();
GitClient *client = GitPlugin::instance()->client();
bool allowFastForward = true;
if (client->isFastForwardMerge(m_repository, branch)) {
QMenu popup;
......@@ -376,7 +376,7 @@ void BranchDialog::rebase()
QTC_CHECK(idx != m_model->currentBranch()); // otherwise the button would not be enabled!
const QString baseBranch = m_model->fullName(idx, true);
GitClient *client = GitPlugin::instance()->gitClient();
GitClient *client = GitPlugin::instance()->client();
if (client->beginStashScope(m_repository, QLatin1String("rebase")))
client->rebase(m_repository, baseBranch);
}
......@@ -389,7 +389,7 @@ void BranchDialog::cherryPick()
QTC_CHECK(idx != m_model->currentBranch()); // otherwise the button would not be enabled!
const QString branch = m_model->fullName(idx, true);
GitPlugin::instance()->gitClient()->synchronousCherryPick(m_repository, branch);
GitPlugin::instance()->client()->synchronousCherryPick(m_repository, branch);
}
void BranchDialog::setRemoteTracking()
......
......@@ -59,10 +59,10 @@ ChangeSelectionDialog::ChangeSelectionDialog(const QString &workingDirectory, Co
, m_command(NoCommand)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
m_gitExecutable = GitPlugin::instance()->gitClient()->vcsBinary();
m_gitExecutable = GitPlugin::instance()->client()->vcsBinary();
m_ui->setupUi(this);
m_ui->workingDirectoryEdit->setText(workingDirectory);
m_gitEnvironment = GitPlugin::instance()->gitClient()->processEnvironment();
m_gitEnvironment = GitPlugin::instance()->client()->processEnvironment();
m_ui->changeNumberEdit->setFocus();
m_ui->changeNumberEdit->selectAll();
......@@ -225,7 +225,7 @@ void ChangeSelectionDialog::recalculateCompletion()
m_oldWorkingDir = workingDir;
if (!workingDir.isEmpty()) {
GitClient *client = GitPlugin::instance()->gitClient();
GitClient *client = GitPlugin::instance()->client();
QStringList args;
args << QLatin1String("--format=%(refname:short)");
QString output;
......
......@@ -110,7 +110,7 @@ QString CloneWizardPage::directoryFromRepository(const QString &urlIn) const
VcsCommand *CloneWizardPage::createCheckoutJob(Utils::FileName *checkoutPath) const
{
const Internal::GitClient *client = Internal::GitPlugin::instance()->gitClient();
const Internal::GitClient *client = Internal::GitPlugin::instance()->client();
const QString workingDirectory = path();
const QString checkoutDir = directory();
*checkoutPath = Utils::FileName::fromString(workingDirectory + QLatin1Char('/') + checkoutDir);
......@@ -137,7 +137,7 @@ QStringList CloneWizardPage::branches(const QString &repository, int *current)
if (repository.isEmpty())
return QStringList();
const QStringList branches = Internal::GitPlugin::instance()->gitClient()->synchronousRepositoryBranches(repository);
const QStringList branches = Internal::GitPlugin::instance()->client()->synchronousRepositoryBranches(repository);
if (!branches.isEmpty())
*current = 0; // default branch is always returned first!
return branches;
......
......@@ -39,7 +39,7 @@ BranchComboBox::BranchComboBox(QWidget *parent) :
QComboBox(parent),
m_detached(false)
{
m_client = GitPlugin::instance()->gitClient();
m_client = GitPlugin::instance()->client();
}
void BranchComboBox::init(const QString &repository)
......
......@@ -280,7 +280,7 @@ QueryContext::QueryContext(const QStringList &queries,
this, &QueryContext::terminate);
m_watcher.setFuture(m_progress.future());
m_process.setProcessEnvironment(Git::Internal::GitPlugin::instance()->
gitClient()->processEnvironment());
client()->processEnvironment());
m_progress.setProgressRange(0, m_queries.size());
// Determine binary and common command line arguments.
......
......@@ -91,7 +91,7 @@ enum FetchMode
static inline GitClient *gitClient()
{
return GitPlugin::instance()->gitClient();
return GitPlugin::instance()->client();
}
/* FetchContext: Retrieves the patch and displays
......
......@@ -138,7 +138,7 @@ GerritPushDialog::GerritPushDialog(const QString &workingDir, const QString &rev
m_ui(new Ui::GerritPushDialog),
m_isValid(false)
{
m_client = GitPlugin::instance()->gitClient();
m_client = GitPlugin::instance()->client();
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
m_ui->setupUi(this);
m_ui->repositoryLabel->setText(QDir::toNativeSeparators(workingDir));
......
......@@ -196,7 +196,7 @@ void BaseController::processOutput(const QString &output)
GitClient *BaseController::gitClient() const
{
return GitPlugin::instance()->gitClient();
return GitPlugin::instance()->client();
}
QStringList BaseController::addHeadWhenCommandInProgress() const
......@@ -477,7 +477,7 @@ public:
// If interactive rebase editor window is closed, plugin is terminated
// but referenced here when the command ends
if (GitPlugin *plugin = GitPlugin::instance()) {
GitClient *client = plugin->gitClient();
GitClient *client = plugin->client();
if (m_commit.isEmpty() && m_files.isEmpty()) {
if (client->checkCommandInProgress(m_workingDirectory) == GitClient::NoCommand)
client->endStashScope(m_workingDirectory);
......@@ -3367,7 +3367,7 @@ unsigned GitClient::synchronousGitVersion(QString *errorMessage) const
}
GitClient::StashInfo::StashInfo() :
m_client(GitPlugin::instance()->gitClient()),
m_client(GitPlugin::instance()->client()),
m_pushAction(NoPush)
{
}
......
......@@ -185,7 +185,7 @@ void GitEditorWidget::setPlainTextFiltered(const QString &text)
{
case AnnotateOutput: {
const bool omitAnnotationDate
= plugin->gitClient()->settings().boolValue(GitSettings::omitAnnotationDateKey);
= plugin->client()->settings().boolValue(GitSettings::omitAnnotationDateKey);
if (omitAnnotationDate)
modText = removeAnnotationDate(text);
break;
......@@ -209,7 +209,7 @@ void GitEditorWidget::commandFinishedGotoLine(bool ok, int exitCode, const QVari
void GitEditorWidget::checkoutChange()
{
GitPlugin::instance()->gitClient()->stashAndCheckout(
GitPlugin::instance()->client()->stashAndCheckout(
sourceWorkingDirectory(), m_currentChange);
}
......@@ -217,7 +217,7 @@ void GitEditorWidget::resetChange(const QByteArray &resetType)
{
const QString workingDir = sourceWorkingDirectory();
GitClient *client = GitPlugin::instance()->gitClient();
GitClient *client = GitPlugin::instance()->client();
if (resetType == "hard"
&& client->gitStatus(workingDir, StatusMode(NoUntracked | NoSubmodules))
!= GitClient::StatusUnchanged) {
......@@ -234,19 +234,19 @@ void GitEditorWidget::resetChange(const QByteArray &resetType)
void GitEditorWidget::cherryPickChange()
{
GitPlugin::instance()->gitClient()->synchronousCherryPick(
GitPlugin::instance()->client()->synchronousCherryPick(
sourceWorkingDirectory(), m_currentChange);
}
void GitEditorWidget::revertChange()
{
GitPlugin::instance()->gitClient()->synchronousRevert(
GitPlugin::instance()->client()->synchronousRevert(
sourceWorkingDirectory(), m_currentChange);
}
void GitEditorWidget::logChange()
{
GitPlugin::instance()->gitClient()->log(
GitPlugin::instance()->client()->log(
sourceWorkingDirectory(), QString(), false, QStringList(m_currentChange));
}
......@@ -261,7 +261,7 @@ void GitEditorWidget::applyDiffChunk(const DiffChunk& chunk, bool revert)
patchFile.write(chunk.chunk);
patchFile.close();
GitClient *client = GitPlugin::instance()->gitClient();
GitClient *client = GitPlugin::instance()->client();
QStringList args = QStringList() << QLatin1String("--cached");
if (revert)
args << QLatin1String("--reverse");
......@@ -314,7 +314,7 @@ bool GitEditorWidget::open(QString *errorString, const QString &fileName, const
const QString gitPath = fi.absolutePath();
setSource(gitPath);
textDocument()->setCodec(
GitPlugin::instance()->gitClient()->encoding(gitPath, "i18n.commitEncoding"));
GitPlugin::instance()->client()->encoding(gitPath, "i18n.commitEncoding"));
}
return VcsBaseEditorWidget::open(errorString, fileName, realFileName);
}
......@@ -325,14 +325,14 @@ QString GitEditorWidget::decorateVersion(const QString &revision) const
const QString workingDirectory = fi.absolutePath();
// Format verbose, SHA1 being first token
return GitPlugin::instance()->gitClient()->synchronousShortDescription(workingDirectory, revision);
return GitPlugin::instance()->client()->synchronousShortDescription(workingDirectory, revision);
}
QStringList GitEditorWidget::annotationPreviousVersions(const QString &revision) const
{
QStringList revisions;
QString errorMessage;
GitClient *client = GitPlugin::instance()->gitClient();
GitClient *client = GitPlugin::instance()->client();
const QFileInfo fi(source());
const QString workingDirectory = fi.absolutePath();
// Get the SHA1's of the file.
......@@ -346,7 +346,7 @@ QStringList GitEditorWidget::annotationPreviousVersions(const QString &revision)
bool GitEditorWidget::isValidRevision(const QString &revision) const
{
return GitPlugin::instance()->gitClient()->isValidRevision(revision);
return GitPlugin::instance()->client()->isValidRevision(revision);
}
void GitEditorWidget::addChangeActions(QMenu *menu, const QString &change)
......
......@@ -1110,7 +1110,7 @@ void GitPlugin::pull()
const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return);
QString topLevel = state.topLevel();
bool rebase = gitClient()->settings().boolValue(GitSettings::pullRebaseKey);
bool rebase = client()->settings().boolValue(GitSettings::pullRebaseKey);
if (!rebase) {
QString currentBranch = m_gitClient->synchronousCurrentLocalBranch(topLevel);
......@@ -1417,11 +1417,11 @@ void GitPlugin::updateRepositoryBrowserAction()
{
const bool repositoryEnabled = currentState().hasTopLevel();
const bool hasRepositoryBrowserCmd
= !gitClient()->settings().stringValue(GitSettings::repositoryBrowserCmd).isEmpty();
= !client()->settings().stringValue(GitSettings::repositoryBrowserCmd).isEmpty();
m_repositoryBrowserAction->setEnabled(repositoryEnabled && hasRepositoryBrowserCmd);
}
GitClient *GitPlugin::gitClient() const
GitClient *GitPlugin::client() const
{
return m_gitClient;
}
......
......@@ -85,7 +85,7 @@ public:
GitVersionControl *gitVersionControl() const;
GitClient *gitClient() const;
GitClient *client() const;
Gerrit::Internal::GerritPlugin *gerritPlugin() const;
public slots:
......
......@@ -100,7 +100,7 @@ public:
void start()
{
GitClient *client = GitPlugin::instance()->gitClient();
GitClient *client = GitPlugin::instance()->client();
QString commitTemplate;
bool success = client->getCommitData(m_workingDirectory, &commitTemplate,
m_commitData, &m_errorMessage);
......@@ -259,7 +259,7 @@ void GitSubmitEditor::updateFileModel()
QFuture<void> future = QtConcurrent::run(m_commitDataFetcher, &CommitDataFetcher::start);
Core::ProgressManager::addTask(future, tr("Refreshing Commit Data"), TASK_UPDATE_COMMIT);
GitPlugin::instance()->gitClient()->addFuture(future);
GitPlugin::instance()->client()->addFuture(future);
}
void GitSubmitEditor::commitDataRetrieved(bool success)
......
......@@ -84,7 +84,7 @@ bool LogChangeWidget::init(const QString &repository, const QString &commit, Log
return true;
if (!(flags & Silent)) {
VcsOutputWindow::appendError(
GitPlugin::instance()->gitClient()->msgNoCommits(flags & IncludeRemotes));
GitPlugin::instance()->client()->msgNoCommits(flags & IncludeRemotes));
}
return false;
}
......@@ -157,7 +157,7 @@ bool LogChangeWidget::populateLog(const QString &repository, const QString &comm
m_model->removeRows(0, rowCount);
// Retrieve log using a custom format "Sha1:Subject [(refs)]"
GitClient *client = GitPlugin::instance()->gitClient();
GitClient *client = GitPlugin::instance()->client();
QStringList arguments;
arguments << QLatin1String("--max-count=1000") << QLatin1String("--format=%h:%s %d");
arguments << (commit.isEmpty() ? QLatin1String("HEAD") : commit);
......@@ -216,7 +216,7 @@ LogChangeDialog::LogChangeDialog(bool isReset, QWidget *parent) :
m_resetTypeComboBox->addItem(tr("Hard"), QLatin1String("--hard"));
m_resetTypeComboBox->addItem(tr("Mixed"), QLatin1String("--mixed"));
m_resetTypeComboBox->addItem(tr("Soft"), QLatin1String("--soft"));
GitClient *client = GitPlugin::instance()->gitClient();
GitClient *client = GitPlugin::instance()->client();
m_resetTypeComboBox->setCurrentIndex(client->settings().intValue(
GitSettings::lastResetIndexKey));
popUpLayout->addWidget(m_resetTypeComboBox);
......@@ -246,7 +246,7 @@ bool LogChangeDialog::runDialog(const QString &repository,
if (QDialog::exec() == QDialog::Accepted) {
if (m_resetTypeComboBox) {
GitClient *client = GitPlugin::instance()->gitClient();
GitClient *client = GitPlugin::instance()->client();
client->settings().setValue(GitSettings::lastResetIndexKey,
m_resetTypeComboBox->currentIndex());
}
......
......@@ -78,7 +78,7 @@ MergeTool::MergeTool(QObject *parent) :
m_mergeType(NormalMerge),
m_localState(UnknownState),
m_remoteState(UnknownState),
m_gitClient(GitPlugin::instance()->gitClient()),
m_client(GitPlugin::instance()->client()),
m_merging(false)
{
}
......@@ -93,7 +93,7 @@ bool MergeTool::start(const QString &workingDirectory, const QStringList &files)
QStringList arguments;
arguments << QLatin1String("mergetool") << QLatin1String("-y");
if (!files.isEmpty()) {
if (m_gitClient->gitVersion() < 0x010708) {
if (m_client->gitVersion() < 0x010708) {
Core::AsynchronousMessageBox::warning(tr("Error"),
tr("File input for the merge tool requires Git 1.7.8, or later."));
return false;
......@@ -102,7 +102,7 @@ bool MergeTool::start(const QString &workingDirectory, const QStringList &files)
}
m_process = new MergeToolProcess(this);
m_process->setWorkingDirectory(workingDirectory);
const Utils::FileName binary = m_gitClient->vcsBinary();
const Utils::FileName binary = m_client->vcsBinary();
VcsOutputWindow::appendCommand(workingDirectory, binary, arguments);
m_process->start(binary.toString(), arguments);
if (m_process->waitForStarted()) {
......@@ -274,7 +274,7 @@ void MergeTool::done()
VcsOutputWindow::appendError(tr("Merge tool process terminated with exit code %1")
.arg(exitCode));
}
m_gitClient->continueCommandIfNeeded(workingDirectory, exitCode == 0);
m_client->continueCommandIfNeeded(workingDirectory, exitCode == 0);
GitPlugin::instance()->gitVersionControl()->emitRepositoryChanged(workingDirectory);
deleteLater();
}
......
......@@ -87,7 +87,7 @@ private:
QString m_localInfo;
FileState m_remoteState;
QString m_remoteInfo;
GitClient *m_gitClient;
GitClient *m_client;
bool m_merging;
};
......
......@@ -86,7 +86,7 @@ void RemoteAdditionDialog::clear()
RemoteDialog::RemoteDialog(QWidget *parent) :
QDialog(parent),
m_ui(new Ui::RemoteDialog),
m_remoteModel(new RemoteModel(GitPlugin::instance()->gitClient(), this)),
m_remoteModel(new RemoteModel(GitPlugin::instance()->client(), this)),
m_addDialog(0)
{
setModal(false);
......
......@@ -107,7 +107,7 @@ QWidget *SettingsPage::widget()
{
if (!m_widget) {
m_widget = new SettingsPageWidget;
m_widget->setSettings(GitPlugin::instance()->gitClient()->settings());
m_widget->setSettings(GitPlugin::instance()->client()->settings());
}
return m_widget;
}
......@@ -124,7 +124,7 @@ void SettingsPage::apply()
Core::AsynchronousMessageBox::warning(tr("Git Settings"), errorMessage);
}
VcsBaseClientSettings &s = GitPlugin::instance()->gitClient()->settings();
VcsBaseClientSettings &s = GitPlugin::instance()->client()->settings();
if (s != newSettings) {
s = newSettings;
s.writeSettings(Core::ICore::settings());
......
......@@ -53,7 +53,7 @@ namespace Internal {
static inline GitClient *gitClient()
{
return GitPlugin::instance()->gitClient();
return GitPlugin::instance()->client();
}
static inline QList<QStandardItem*> stashModelRowItems(const Stash &s)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment