diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2020-02-25 20:20:25 +0200 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2020-02-26 10:29:27 +0000 |
commit | 7c4f0a9b1ed29e9440211e37e45d0e3451ac2a62 (patch) | |
tree | b37f939747b7450136552a55d9930823b8659a8b /src/plugins/git/logchangedialog.cpp | |
parent | 5765bd8507b1e76ef61176435ce357962fb9b291 (diff) |
Git: Store singleton instance in GitClient
On many cases, GitPlugin is not required at all, and is only used as
a proxy for GitClient.
Change-Id: I246012658ab3e8c7a12f1a459b1b1748ff358e0b
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/git/logchangedialog.cpp')
-rw-r--r-- | src/plugins/git/logchangedialog.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/plugins/git/logchangedialog.cpp b/src/plugins/git/logchangedialog.cpp index 25c59bbcb7..d4b0a9602d 100644 --- a/src/plugins/git/logchangedialog.cpp +++ b/src/plugins/git/logchangedialog.cpp @@ -24,7 +24,6 @@ ****************************************************************************/ #include "logchangedialog.h" -#include "gitplugin.h" #include "gitclient.h" #include <vcsbase/vcsoutputwindow.h> @@ -79,7 +78,7 @@ bool LogChangeWidget::init(const QString &repository, const QString &commit, Log return true; if (!(flags & Silent)) { VcsOutputWindow::appendError( - GitPlugin::client()->msgNoCommits(flags & IncludeRemotes)); + GitClient::instance()->msgNoCommits(flags & IncludeRemotes)); } return false; } @@ -159,8 +158,10 @@ bool LogChangeWidget::populateLog(const QString &repository, const QString &comm arguments << "--not" << "--remotes"; arguments << "--"; QString output; - if (!GitPlugin::client()->synchronousLog(repository, arguments, &output, nullptr, VcsCommand::NoOutput)) + if (!GitClient::instance()->synchronousLog( + repository, arguments, &output, nullptr, VcsCommand::NoOutput)) { return false; + } const QStringList lines = output.split('\n'); for (const QString &line : lines) { const int colonPos = line.indexOf(':'); @@ -211,8 +212,8 @@ LogChangeDialog::LogChangeDialog(bool isReset, QWidget *parent) : m_resetTypeComboBox->addItem(tr("Hard"), "--hard"); m_resetTypeComboBox->addItem(tr("Mixed"), "--mixed"); m_resetTypeComboBox->addItem(tr("Soft"), "--soft"); - m_resetTypeComboBox->setCurrentIndex(GitPlugin::client()->settings().intValue( - GitSettings::lastResetIndexKey)); + m_resetTypeComboBox->setCurrentIndex( + GitClient::instance()->settings().intValue(GitSettings::lastResetIndexKey)); popUpLayout->addWidget(m_resetTypeComboBox); popUpLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored)); } @@ -239,8 +240,8 @@ bool LogChangeDialog::runDialog(const QString &repository, if (QDialog::exec() == QDialog::Accepted) { if (m_resetTypeComboBox) { - GitPlugin::client()->settings().setValue(GitSettings::lastResetIndexKey, - m_resetTypeComboBox->currentIndex()); + GitClient::instance()->settings().setValue( + GitSettings::lastResetIndexKey, m_resetTypeComboBox->currentIndex()); } return true; } |