summaryrefslogtreecommitdiff
path: root/src/plugins/git/gerrit/gerritplugin.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2020-02-07 11:24:32 +0100
committerhjk <hjk@qt.io>2020-02-07 12:56:10 +0000
commiteb1226df68edb2180425fda8411f57aab06c7b5f (patch)
tree83cab0eb431c1bf50efe9672da473f22caced496 /src/plugins/git/gerrit/gerritplugin.cpp
parent4e357e84c03c629a284c1f5505908f8a7644fba9 (diff)
downloadqt-creator-eb1226df68edb2180425fda8411f57aab06c7b5f.tar.gz
Git: Partially move plugin pimpl to .cpp
Same procedure as for ClearCase. Unfortuately, some deep accesses are not easy to get rid of. Make them available by static functions in the plugin itself. Definitely not the favorite setup, but allows to proceed with the QObject removals. Change-Id: Id85ed07bc7a6c1c053431a14dd7f68892f7ebea0 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/git/gerrit/gerritplugin.cpp')
-rw-r--r--src/plugins/git/gerrit/gerritplugin.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/plugins/git/gerrit/gerritplugin.cpp b/src/plugins/git/gerrit/gerritplugin.cpp
index 598a6fb75d..656f1e34f7 100644
--- a/src/plugins/git/gerrit/gerritplugin.cpp
+++ b/src/plugins/git/gerrit/gerritplugin.cpp
@@ -148,7 +148,7 @@ FetchContext::FetchContext(const QSharedPointer<GerritChange> &change,
connect(&m_watcher, &QFutureWatcher<void>::canceled, this, &FetchContext::terminate);
m_watcher.setFuture(m_progress.future());
m_process.setWorkingDirectory(repository);
- m_process.setProcessEnvironment(GitPluginPrivate::client()->processEnvironment());
+ m_process.setProcessEnvironment(GitPlugin::client()->processEnvironment());
m_process.closeWriteChannel();
}
@@ -240,7 +240,7 @@ void FetchContext::show()
{
const QString title = QString::number(m_change->number) + '/'
+ QString::number(m_change->currentPatchSet.patchSetNumber);
- GitPluginPrivate::client()->show(m_repository, "FETCH_HEAD", title);
+ GitPlugin::client()->show(m_repository, "FETCH_HEAD", title);
}
void FetchContext::cherryPick()
@@ -248,12 +248,12 @@ void FetchContext::cherryPick()
// Point user to errors.
VcsBase::VcsOutputWindow::instance()->popup(IOutputPane::ModeSwitch
| IOutputPane::WithFocus);
- GitPluginPrivate::client()->synchronousCherryPick(m_repository, "FETCH_HEAD");
+ GitPlugin::client()->synchronousCherryPick(m_repository, "FETCH_HEAD");
}
void FetchContext::checkout()
{
- GitPluginPrivate::client()->checkout(m_repository, "FETCH_HEAD");
+ GitPlugin::client()->checkout(m_repository, "FETCH_HEAD");
}
void FetchContext::terminate()
@@ -328,12 +328,12 @@ void GerritPlugin::push(const QString &topLevel)
dialog.storeTopic();
m_reviewers = dialog.reviewers();
- GitPluginPrivate::client()->push(topLevel, {dialog.selectedRemoteName(), dialog.pushTarget()});
+ GitPlugin::client()->push(topLevel, {dialog.selectedRemoteName(), dialog.pushTarget()});
}
static QString currentRepository()
{
- return GitPluginPrivate::instance()->currentState().topLevel();
+ return GitPlugin::currentState().topLevel();
}
// Open or raise the Gerrit dialog window.
@@ -375,19 +375,19 @@ void GerritPlugin::push()
Utils::FilePath GerritPlugin::gitBinDirectory()
{
- return GitPluginPrivate::client()->gitBinDirectory();
+ return GitPlugin::client()->gitBinDirectory();
}
// Find the branch of a repository.
QString GerritPlugin::branch(const QString &repository)
{
- return GitPluginPrivate::client()->synchronousCurrentLocalBranch(repository);
+ return GitPlugin::client()->synchronousCurrentLocalBranch(repository);
}
void GerritPlugin::fetch(const QSharedPointer<GerritChange> &change, int mode)
{
// Locate git.
- const Utils::FilePath git = GitPluginPrivate::client()->vcsBinary();
+ const Utils::FilePath git = GitPlugin::client()->vcsBinary();
if (git.isEmpty()) {
VcsBase::VcsOutputWindow::appendError(tr("Git is not available."));
return;
@@ -400,7 +400,7 @@ void GerritPlugin::fetch(const QSharedPointer<GerritChange> &change, int mode)
if (!repository.isEmpty()) {
// Check if remote from a working dir is the same as remote from patch
- QMap<QString, QString> remotesList = GitPluginPrivate::client()->synchronousRemotesList(repository);
+ QMap<QString, QString> remotesList = GitPlugin::client()->synchronousRemotesList(repository);
if (!remotesList.isEmpty()) {
const QStringList remotes = remotesList.values();
for (QString remote : remotes) {
@@ -413,7 +413,7 @@ void GerritPlugin::fetch(const QSharedPointer<GerritChange> &change, int mode)
}
if (!verifiedRepository) {
- const SubmoduleDataMap submodules = GitPluginPrivate::client()->submoduleList(repository);
+ const SubmoduleDataMap submodules = GitPlugin::client()->submoduleList(repository);
for (const SubmoduleData &submoduleData : submodules) {
QString remote = submoduleData.url;
if (remote.endsWith(".git"))
@@ -472,7 +472,7 @@ void GerritPlugin::fetch(const QSharedPointer<GerritChange> &change, int mode)
// Try to find a matching repository for a project by asking the VcsManager.
QString GerritPlugin::findLocalRepository(QString project, const QString &branch) const
{
- const QStringList gitRepositories = VcsManager::repositories(GitPluginPrivate::instance());
+ const QStringList gitRepositories = VcsManager::repositories(GitPlugin::versionControl());
// Determine key (file name) to look for (qt/qtbase->'qtbase').
const int slashPos = project.lastIndexOf('/');
if (slashPos != -1)