forked from qt-creator/qt-creator
Vcs: Pimpl plugins
Essentially rename all *Plugin into *PluginPrivate, and pull out the actual IPlugin related pieces into new *Plugin classes. Shift the construction of the PluginPrivate to initialize(), following the general pattern. I tried to keep the patch as mechanical as possible, giving room to some obvious but less mechanical cleanup needs, that are intentionally left out of this here. Change-Id: Iac662bf73338f9f7669064ed67b960246875c23c Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -129,25 +129,23 @@ const VcsBaseEditorParameters editorParameters[] = {
|
||||
|
||||
// GitPlugin
|
||||
|
||||
static GitPlugin *m_instance = nullptr;
|
||||
static GitPluginPrivate *dd = nullptr;
|
||||
|
||||
GitPlugin::GitPlugin()
|
||||
{
|
||||
m_instance = this;
|
||||
m_fileActions.reserve(10);
|
||||
m_projectActions.reserve(10);
|
||||
m_repositoryActions.reserve(50);
|
||||
}
|
||||
|
||||
GitPlugin::~GitPlugin()
|
||||
GitPluginPrivate::~GitPluginPrivate()
|
||||
{
|
||||
cleanCommitMessageFile();
|
||||
delete m_gitClient;
|
||||
delete m_branchViewFactory;
|
||||
m_instance = nullptr;
|
||||
}
|
||||
|
||||
void GitPlugin::cleanCommitMessageFile()
|
||||
|
||||
GitPlugin::~GitPlugin()
|
||||
{
|
||||
delete dd;
|
||||
dd = nullptr;
|
||||
}
|
||||
|
||||
void GitPluginPrivate::cleanCommitMessageFile()
|
||||
{
|
||||
if (!m_commitMessageFileName.isEmpty()) {
|
||||
QFile::remove(m_commitMessageFileName);
|
||||
@@ -155,22 +153,22 @@ void GitPlugin::cleanCommitMessageFile()
|
||||
}
|
||||
}
|
||||
|
||||
bool GitPlugin::isCommitEditorOpen() const
|
||||
bool GitPluginPrivate::isCommitEditorOpen() const
|
||||
{
|
||||
return !m_commitMessageFileName.isEmpty();
|
||||
}
|
||||
|
||||
GitPlugin *GitPlugin::instance()
|
||||
GitPluginPrivate *GitPluginPrivate::instance()
|
||||
{
|
||||
return m_instance;
|
||||
return dd;
|
||||
}
|
||||
|
||||
GitClient *GitPlugin::client()
|
||||
GitClient *GitPluginPrivate::client()
|
||||
{
|
||||
return m_instance->m_gitClient;
|
||||
return dd->m_gitClient;
|
||||
}
|
||||
|
||||
QString GitPlugin::msgRepositoryLabel(const QString &repository)
|
||||
QString GitPluginPrivate::msgRepositoryLabel(const QString &repository)
|
||||
{
|
||||
return repository.isEmpty() ?
|
||||
tr("<No repository>") :
|
||||
@@ -179,7 +177,7 @@ QString GitPlugin::msgRepositoryLabel(const QString &repository)
|
||||
|
||||
// Returns a regular expression pattern with characters not allowed
|
||||
// in branch and remote names.
|
||||
QString GitPlugin::invalidBranchAndRemoteNamePattern()
|
||||
QString GitPluginPrivate::invalidBranchAndRemoteNamePattern()
|
||||
{
|
||||
return QLatin1String(
|
||||
"\\s" // no whitespace
|
||||
@@ -206,7 +204,7 @@ const VcsBaseSubmitEditorParameters submitParameters = {
|
||||
VcsBaseSubmitEditorParameters::DiffRows
|
||||
};
|
||||
|
||||
Command *GitPlugin::createCommand(QAction *action, ActionContainer *ac, Id id,
|
||||
Command *GitPluginPrivate::createCommand(QAction *action, ActionContainer *ac, Id id,
|
||||
const Context &context, bool addToLocator,
|
||||
const std::function<void()> &callback, const QKeySequence &keys)
|
||||
{
|
||||
@@ -222,7 +220,7 @@ Command *GitPlugin::createCommand(QAction *action, ActionContainer *ac, Id id,
|
||||
}
|
||||
|
||||
// Create a parameter action
|
||||
ParameterAction *GitPlugin::createParameterAction(ActionContainer *ac,
|
||||
ParameterAction *GitPluginPrivate::createParameterAction(ActionContainer *ac,
|
||||
const QString &defaultText, const QString ¶meterText,
|
||||
Id id, const Context &context,
|
||||
bool addToLocator, const std::function<void()> &callback,
|
||||
@@ -235,7 +233,7 @@ ParameterAction *GitPlugin::createParameterAction(ActionContainer *ac,
|
||||
}
|
||||
|
||||
// Create an action to act on a file.
|
||||
QAction *GitPlugin::createFileAction(ActionContainer *ac,
|
||||
QAction *GitPluginPrivate::createFileAction(ActionContainer *ac,
|
||||
const QString &defaultText, const QString ¶meterText,
|
||||
Id id, const Context &context, bool addToLocator,
|
||||
const std::function<void()> &callback,
|
||||
@@ -247,9 +245,9 @@ QAction *GitPlugin::createFileAction(ActionContainer *ac,
|
||||
return action;
|
||||
}
|
||||
|
||||
QAction *GitPlugin::createProjectAction(ActionContainer *ac, const QString &defaultText,
|
||||
QAction *GitPluginPrivate::createProjectAction(ActionContainer *ac, const QString &defaultText,
|
||||
const QString ¶meterText, Id id, const Context &context,
|
||||
bool addToLocator, void (GitPlugin::*func)(),
|
||||
bool addToLocator, void (GitPluginPrivate::*func)(),
|
||||
const QKeySequence &keys)
|
||||
{
|
||||
ParameterAction *action = createParameterAction(ac, defaultText, parameterText, id, context,
|
||||
@@ -259,7 +257,7 @@ QAction *GitPlugin::createProjectAction(ActionContainer *ac, const QString &defa
|
||||
}
|
||||
|
||||
// Create an action to act on the repository
|
||||
QAction *GitPlugin::createRepositoryAction(ActionContainer *ac, const QString &text, Id id,
|
||||
QAction *GitPluginPrivate::createRepositoryAction(ActionContainer *ac, const QString &text, Id id,
|
||||
const Context &context, bool addToLocator,
|
||||
const std::function<void()> &callback,
|
||||
const QKeySequence &keys)
|
||||
@@ -270,17 +268,17 @@ QAction *GitPlugin::createRepositoryAction(ActionContainer *ac, const QString &t
|
||||
return action;
|
||||
}
|
||||
|
||||
QAction *GitPlugin::createChangeRelatedRepositoryAction(const QString &text, Id id,
|
||||
QAction *GitPluginPrivate::createChangeRelatedRepositoryAction(const QString &text, Id id,
|
||||
const Context &context)
|
||||
{
|
||||
return createRepositoryAction(nullptr, text, id, context, true,
|
||||
std::bind(&GitPlugin::startChangeRelatedAction, this, id),
|
||||
std::bind(&GitPluginPrivate::startChangeRelatedAction, this, id),
|
||||
QKeySequence());
|
||||
}
|
||||
|
||||
// Action to act on the repository forwarded to a git client member function
|
||||
// taking the directory.
|
||||
QAction *GitPlugin::createRepositoryAction(ActionContainer *ac, const QString &text, Id id,
|
||||
QAction *GitPluginPrivate::createRepositoryAction(ActionContainer *ac, const QString &text, Id id,
|
||||
const Context &context, bool addToLocator,
|
||||
GitClientMemberFunc func, const QKeySequence &keys)
|
||||
{
|
||||
@@ -296,6 +294,29 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
{
|
||||
Q_UNUSED(errorMessage)
|
||||
|
||||
dd = new GitPluginPrivate;
|
||||
|
||||
auto cmdContext = new QObject(this);
|
||||
connect(Core::ICore::instance(), &Core::ICore::coreOpened, cmdContext, [this, cmdContext, arguments] {
|
||||
remoteCommand(arguments, QDir::currentPath(), {});
|
||||
cmdContext->deleteLater();
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void GitPlugin::extensionsInitialized()
|
||||
{
|
||||
dd->extensionsInitialized() ;
|
||||
}
|
||||
|
||||
GitPluginPrivate::GitPluginPrivate()
|
||||
{
|
||||
dd = this;
|
||||
m_fileActions.reserve(10);
|
||||
m_projectActions.reserve(10);
|
||||
m_repositoryActions.reserve(50);
|
||||
|
||||
Context context(Constants::GIT_CONTEXT);
|
||||
|
||||
m_gitClient = new GitClient;
|
||||
@@ -306,7 +327,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
// Create the settings Page
|
||||
auto settingsPage = new SettingsPage(vc, this);
|
||||
connect(settingsPage, &SettingsPage::settingsChanged,
|
||||
this, &GitPlugin::updateRepositoryBrowserAction);
|
||||
this, &GitPluginPrivate::updateRepositoryBrowserAction);
|
||||
|
||||
new GitGrep(this);
|
||||
m_branchViewFactory = new BranchViewFactory;
|
||||
@@ -340,33 +361,33 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
gitContainer->addMenu(currentFileMenu);
|
||||
|
||||
createFileAction(currentFileMenu, tr("Diff Current File"), tr("Diff of \"%1\""),
|
||||
"Git.Diff", context, true, std::bind(&GitPlugin::diffCurrentFile, this),
|
||||
"Git.Diff", context, true, std::bind(&GitPluginPrivate::diffCurrentFile, this),
|
||||
QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+D") : tr("Alt+G,Alt+D")));
|
||||
|
||||
createFileAction(currentFileMenu, tr("Log Current File"), tr("Log of \"%1\""),
|
||||
"Git.Log", context, true, std::bind(&GitPlugin::logFile, this),
|
||||
"Git.Log", context, true, std::bind(&GitPluginPrivate::logFile, this),
|
||||
QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+L") : tr("Alt+G,Alt+L")));
|
||||
|
||||
createFileAction(currentFileMenu, tr("Blame Current File"), tr("Blame for \"%1\""),
|
||||
"Git.Blame", context, true, std::bind(&GitPlugin::blameFile, this),
|
||||
"Git.Blame", context, true, std::bind(&GitPluginPrivate::blameFile, this),
|
||||
QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+B") : tr("Alt+G,Alt+B")));
|
||||
|
||||
currentFileMenu->addSeparator(context);
|
||||
|
||||
createFileAction(currentFileMenu, tr("Stage File for Commit"), tr("Stage \"%1\" for Commit"),
|
||||
"Git.Stage", context, true, std::bind(&GitPlugin::stageFile, this),
|
||||
"Git.Stage", context, true, std::bind(&GitPluginPrivate::stageFile, this),
|
||||
QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+A") : tr("Alt+G,Alt+A")));
|
||||
|
||||
createFileAction(currentFileMenu, tr("Unstage File from Commit"), tr("Unstage \"%1\" from Commit"),
|
||||
"Git.Unstage", context, true, std::bind(&GitPlugin::unstageFile, this));
|
||||
"Git.Unstage", context, true, std::bind(&GitPluginPrivate::unstageFile, this));
|
||||
|
||||
createFileAction(currentFileMenu, tr("Undo Unstaged Changes"), tr("Undo Unstaged Changes for \"%1\""),
|
||||
"Git.UndoUnstaged", context,
|
||||
true, std::bind(&GitPlugin::undoFileChanges, this, false));
|
||||
true, std::bind(&GitPluginPrivate::undoFileChanges, this, false));
|
||||
|
||||
createFileAction(currentFileMenu, tr("Undo Uncommitted Changes"), tr("Undo Uncommitted Changes for \"%1\""),
|
||||
"Git.Undo", context,
|
||||
true, std::bind(&GitPlugin::undoFileChanges, this, true),
|
||||
true, std::bind(&GitPluginPrivate::undoFileChanges, this, true),
|
||||
QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+U") : tr("Alt+G,Alt+U")));
|
||||
|
||||
|
||||
@@ -376,15 +397,15 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
gitContainer->addMenu(currentProjectMenu);
|
||||
|
||||
createProjectAction(currentProjectMenu, tr("Diff Current Project"), tr("Diff Project \"%1\""),
|
||||
"Git.DiffProject", context, true, &GitPlugin::diffCurrentProject,
|
||||
"Git.DiffProject", context, true, &GitPluginPrivate::diffCurrentProject,
|
||||
QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+Shift+D") : tr("Alt+G,Alt+Shift+D")));
|
||||
|
||||
createProjectAction(currentProjectMenu, tr("Log Project"), tr("Log Project \"%1\""),
|
||||
"Git.LogProject", context, true, &GitPlugin::logProject,
|
||||
"Git.LogProject", context, true, &GitPluginPrivate::logProject,
|
||||
QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+K") : tr("Alt+G,Alt+K")));
|
||||
|
||||
createProjectAction(currentProjectMenu, tr("Clean Project..."), tr("Clean Project \"%1\"..."),
|
||||
"Git.CleanProject", context, true, &GitPlugin::cleanProject);
|
||||
"Git.CleanProject", context, true, &GitPluginPrivate::cleanProject);
|
||||
|
||||
|
||||
/* "Local Repository" menu */
|
||||
@@ -396,7 +417,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
context, true, &GitClient::diffRepository);
|
||||
|
||||
createRepositoryAction(localRepositoryMenu, tr("Log"), "Git.LogRepository",
|
||||
context, true, std::bind(&GitPlugin::logRepository, this));
|
||||
context, true, std::bind(&GitPluginPrivate::logRepository, this));
|
||||
|
||||
createRepositoryAction(localRepositoryMenu, tr("Reflog"), "Git.ReflogRepository",
|
||||
context, true, &GitClient::reflog);
|
||||
@@ -411,88 +432,88 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
localRepositoryMenu->addSeparator(context);
|
||||
|
||||
createRepositoryAction(localRepositoryMenu, tr("Commit..."), "Git.Commit",
|
||||
context, true, std::bind(&GitPlugin::startCommit, this, SimpleCommit),
|
||||
context, true, std::bind(&GitPluginPrivate::startCommit, this, SimpleCommit),
|
||||
QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+C") : tr("Alt+G,Alt+C")));
|
||||
|
||||
createRepositoryAction(localRepositoryMenu, tr("Amend Last Commit..."), "Git.AmendCommit",
|
||||
context, true, std::bind(&GitPlugin::startCommit, this, AmendCommit));
|
||||
context, true, std::bind(&GitPluginPrivate::startCommit, this, AmendCommit));
|
||||
|
||||
m_fixupCommitAction
|
||||
= createRepositoryAction(localRepositoryMenu,
|
||||
tr("Fixup Previous Commit..."), "Git.FixupCommit", context, true,
|
||||
std::bind(&GitPlugin::startCommit, this, FixupCommit));
|
||||
std::bind(&GitPluginPrivate::startCommit, this, FixupCommit));
|
||||
|
||||
// --------------
|
||||
localRepositoryMenu->addSeparator(context);
|
||||
|
||||
createRepositoryAction(localRepositoryMenu, tr("Reset..."), "Git.Reset",
|
||||
context, true, std::bind(&GitPlugin::resetRepository, this));
|
||||
context, true, std::bind(&GitPluginPrivate::resetRepository, this));
|
||||
|
||||
createRepositoryAction(localRepositoryMenu, tr("Recover Deleted Files"), "Git.RecoverDeleted",
|
||||
context, true, std::bind(&GitPlugin::recoverDeletedFiles, this));
|
||||
context, true, std::bind(&GitPluginPrivate::recoverDeletedFiles, this));
|
||||
|
||||
m_interactiveRebaseAction
|
||||
= createRepositoryAction(localRepositoryMenu,
|
||||
tr("Interactive Rebase..."), "Git.InteractiveRebase",
|
||||
context, true, std::bind(&GitPlugin::startRebase, this));
|
||||
context, true, std::bind(&GitPluginPrivate::startRebase, this));
|
||||
|
||||
m_submoduleUpdateAction
|
||||
= createRepositoryAction(localRepositoryMenu,
|
||||
tr("Update Submodules"), "Git.SubmoduleUpdate",
|
||||
context, true, std::bind(&GitPlugin::updateSubmodules, this));
|
||||
context, true, std::bind(&GitPluginPrivate::updateSubmodules, this));
|
||||
m_abortMergeAction
|
||||
= createRepositoryAction(localRepositoryMenu,
|
||||
tr("Abort Merge"), "Git.MergeAbort",
|
||||
context, true,
|
||||
std::bind(&GitPlugin::continueOrAbortCommand, this));
|
||||
std::bind(&GitPluginPrivate::continueOrAbortCommand, this));
|
||||
|
||||
m_abortRebaseAction
|
||||
= createRepositoryAction(localRepositoryMenu,
|
||||
tr("Abort Rebase"), "Git.RebaseAbort",
|
||||
context, true,
|
||||
std::bind(&GitPlugin::continueOrAbortCommand, this));
|
||||
std::bind(&GitPluginPrivate::continueOrAbortCommand, this));
|
||||
|
||||
m_abortCherryPickAction
|
||||
= createRepositoryAction(localRepositoryMenu,
|
||||
tr("Abort Cherry Pick"), "Git.CherryPickAbort",
|
||||
context, true,
|
||||
std::bind(&GitPlugin::continueOrAbortCommand, this));
|
||||
std::bind(&GitPluginPrivate::continueOrAbortCommand, this));
|
||||
|
||||
m_abortRevertAction
|
||||
= createRepositoryAction(localRepositoryMenu,
|
||||
tr("Abort Revert"), "Git.RevertAbort",
|
||||
context, true,
|
||||
std::bind(&GitPlugin::continueOrAbortCommand, this));
|
||||
std::bind(&GitPluginPrivate::continueOrAbortCommand, this));
|
||||
|
||||
m_continueRebaseAction
|
||||
= createRepositoryAction(localRepositoryMenu,
|
||||
tr("Continue Rebase"), "Git.RebaseContinue",
|
||||
context, true,
|
||||
std::bind(&GitPlugin::continueOrAbortCommand, this));
|
||||
std::bind(&GitPluginPrivate::continueOrAbortCommand, this));
|
||||
|
||||
m_skipRebaseAction
|
||||
= createRepositoryAction(localRepositoryMenu,
|
||||
tr("Skip Rebase"), "Git.RebaseSkip",
|
||||
context, true,
|
||||
std::bind(&GitPlugin::continueOrAbortCommand, this));
|
||||
std::bind(&GitPluginPrivate::continueOrAbortCommand, this));
|
||||
|
||||
m_continueCherryPickAction
|
||||
= createRepositoryAction(localRepositoryMenu,
|
||||
tr("Continue Cherry Pick"), "Git.CherryPickContinue",
|
||||
context, true,
|
||||
std::bind(&GitPlugin::continueOrAbortCommand, this));
|
||||
std::bind(&GitPluginPrivate::continueOrAbortCommand, this));
|
||||
|
||||
m_continueRevertAction
|
||||
= createRepositoryAction(localRepositoryMenu,
|
||||
tr("Continue Revert"), "Git.RevertContinue",
|
||||
context, true,
|
||||
std::bind(&GitPlugin::continueOrAbortCommand, this));
|
||||
std::bind(&GitPluginPrivate::continueOrAbortCommand, this));
|
||||
|
||||
// --------------
|
||||
localRepositoryMenu->addSeparator(context);
|
||||
|
||||
createRepositoryAction(localRepositoryMenu, tr("Branches..."), "Git.BranchList",
|
||||
context, true, std::bind(&GitPlugin::branchList, this));
|
||||
context, true, std::bind(&GitPluginPrivate::branchList, this));
|
||||
|
||||
// --------------
|
||||
localRepositoryMenu->addSeparator(context);
|
||||
@@ -507,9 +528,9 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
= createParameterAction(patchMenu,
|
||||
tr("Apply from Editor"), tr("Apply \"%1\""),
|
||||
"Git.ApplyCurrentFilePatch",
|
||||
context, true, std::bind(&GitPlugin::applyCurrentFilePatch, this));
|
||||
context, true, std::bind(&GitPluginPrivate::applyCurrentFilePatch, this));
|
||||
createRepositoryAction(patchMenu, tr("Apply from File..."), "Git.ApplyPatch",
|
||||
context, true, std::bind(&GitPlugin::promptApplyPatch, this));
|
||||
context, true, std::bind(&GitPluginPrivate::promptApplyPatch, this));
|
||||
|
||||
// "Stash" menu
|
||||
ActionContainer *stashMenu = ActionManager::createMenu("Git.StashMenu");
|
||||
@@ -517,27 +538,27 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
localRepositoryMenu->addMenu(stashMenu);
|
||||
|
||||
createRepositoryAction(stashMenu, tr("Stashes..."), "Git.StashList",
|
||||
context, false, std::bind(&GitPlugin::stashList, this));
|
||||
context, false, std::bind(&GitPluginPrivate::stashList, this));
|
||||
|
||||
stashMenu->addSeparator(context);
|
||||
|
||||
QAction *action = createRepositoryAction(stashMenu, tr("Stash"), "Git.Stash",
|
||||
context, true, std::bind(&GitPlugin::stash, this, false));
|
||||
context, true, std::bind(&GitPluginPrivate::stash, this, false));
|
||||
action->setToolTip(tr("Saves the current state of your work and resets the repository."));
|
||||
|
||||
action = createRepositoryAction(stashMenu, tr("Stash Unstaged Files"), "Git.StashUnstaged",
|
||||
context, true, std::bind(&GitPlugin::stashUnstaged, this));
|
||||
context, true, std::bind(&GitPluginPrivate::stashUnstaged, this));
|
||||
action->setToolTip(tr("Saves the current state of your unstaged files and resets the repository "
|
||||
"to its staged state."));
|
||||
|
||||
action = createRepositoryAction(stashMenu, tr("Take Snapshot..."), "Git.StashSnapshot",
|
||||
context, true, std::bind(&GitPlugin::stashSnapshot, this));
|
||||
context, true, std::bind(&GitPluginPrivate::stashSnapshot, this));
|
||||
action->setToolTip(tr("Saves the current state of your work."));
|
||||
|
||||
stashMenu->addSeparator(context);
|
||||
|
||||
action = createRepositoryAction(stashMenu, tr("Stash Pop"), "Git.StashPop",
|
||||
context, true, std::bind(&GitPlugin::stashPop, this));
|
||||
context, true, std::bind(&GitPluginPrivate::stashPop, this));
|
||||
action->setToolTip(tr("Restores changes saved to the stash list using \"Stash\"."));
|
||||
|
||||
|
||||
@@ -551,13 +572,13 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
gitContainer->addMenu(remoteRepositoryMenu);
|
||||
|
||||
createRepositoryAction(remoteRepositoryMenu, tr("Fetch"), "Git.Fetch",
|
||||
context, true, std::bind(&GitPlugin::fetch, this));
|
||||
context, true, std::bind(&GitPluginPrivate::fetch, this));
|
||||
|
||||
createRepositoryAction(remoteRepositoryMenu, tr("Pull"), "Git.Pull",
|
||||
context, true, std::bind(&GitPlugin::pull, this));
|
||||
context, true, std::bind(&GitPluginPrivate::pull, this));
|
||||
|
||||
createRepositoryAction(remoteRepositoryMenu, tr("Push"), "Git.Push",
|
||||
context, true, std::bind(&GitPlugin::push, this));
|
||||
context, true, std::bind(&GitPluginPrivate::push, this));
|
||||
|
||||
// --------------
|
||||
remoteRepositoryMenu->addSeparator(context);
|
||||
@@ -580,7 +601,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
remoteRepositoryMenu->addSeparator(context);
|
||||
|
||||
createRepositoryAction(remoteRepositoryMenu, tr("Manage Remotes..."), "Git.RemoteList",
|
||||
context, false, std::bind(&GitPlugin::manageRemotes, this));
|
||||
context, false, std::bind(&GitPluginPrivate::manageRemotes, this));
|
||||
|
||||
/* \"Remote Repository" menu */
|
||||
|
||||
@@ -594,9 +615,9 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
createChangeRelatedRepositoryAction(tr("Archive..."), "Git.Archive", context);
|
||||
|
||||
createRepositoryAction(nullptr, tr("Rebase..."), "Git.Rebase", context, true,
|
||||
std::bind(&GitPlugin::branchList, this));
|
||||
std::bind(&GitPluginPrivate::branchList, this));
|
||||
createRepositoryAction(nullptr, tr("Merge..."), "Git.Merge", context, true,
|
||||
std::bind(&GitPlugin::branchList, this));
|
||||
std::bind(&GitPluginPrivate::branchList, this));
|
||||
/* \Actions only in locator */
|
||||
|
||||
// --------------
|
||||
@@ -610,16 +631,16 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
context, true, &GitClient::launchGitK);
|
||||
|
||||
createFileAction(gitToolsMenu, tr("Gitk Current File"), tr("Gitk of \"%1\""),
|
||||
"Git.GitkFile", context, true, std::bind(&GitPlugin::gitkForCurrentFile, this));
|
||||
"Git.GitkFile", context, true, std::bind(&GitPluginPrivate::gitkForCurrentFile, this));
|
||||
|
||||
createFileAction(gitToolsMenu, tr("Gitk for folder of Current File"), tr("Gitk for folder of \"%1\""),
|
||||
"Git.GitkFolder", context, true, std::bind(&GitPlugin::gitkForCurrentFolder, this));
|
||||
"Git.GitkFolder", context, true, std::bind(&GitPluginPrivate::gitkForCurrentFolder, this));
|
||||
|
||||
// --------------
|
||||
gitToolsMenu->addSeparator(context);
|
||||
|
||||
createRepositoryAction(gitToolsMenu, tr("Git Gui"), "Git.GitGui",
|
||||
context, true, std::bind(&GitPlugin::gitGui, this));
|
||||
context, true, std::bind(&GitPluginPrivate::gitGui, this));
|
||||
|
||||
// --------------
|
||||
gitToolsMenu->addSeparator(context);
|
||||
@@ -631,7 +652,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
|
||||
m_mergeToolAction
|
||||
= createRepositoryAction(gitToolsMenu, tr("Merge Tool"), "Git.MergeTool",
|
||||
context, true, std::bind(&GitPlugin::startMergeTool, this));
|
||||
context, true, std::bind(&GitPluginPrivate::startMergeTool, this));
|
||||
|
||||
/* \"Git Tools" menu */
|
||||
|
||||
@@ -648,42 +669,34 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
QAction *createRepositoryAction = new QAction(tr("Create Repository..."), this);
|
||||
Command *createRepositoryCommand = ActionManager::registerAction(
|
||||
createRepositoryAction, "Git.CreateRepository");
|
||||
connect(createRepositoryAction, &QAction::triggered, this, &GitPlugin::createRepository);
|
||||
connect(createRepositoryAction, &QAction::triggered, this, &GitPluginPrivate::createRepository);
|
||||
gitContainer->addAction(createRepositoryCommand);
|
||||
|
||||
connect(VcsManager::instance(), &VcsManager::repositoryChanged,
|
||||
this, &GitPlugin::updateContinueAndAbortCommands);
|
||||
this, &GitPluginPrivate::updateContinueAndAbortCommands);
|
||||
connect(VcsManager::instance(), &VcsManager::repositoryChanged,
|
||||
this, &GitPlugin::updateBranches, Qt::QueuedConnection);
|
||||
this, &GitPluginPrivate::updateBranches, Qt::QueuedConnection);
|
||||
|
||||
/* "Gerrit" */
|
||||
m_gerritPlugin = new Gerrit::Internal::GerritPlugin(this);
|
||||
const bool ok = m_gerritPlugin->initialize(remoteRepositoryMenu);
|
||||
m_gerritPlugin->initialize(remoteRepositoryMenu);
|
||||
m_gerritPlugin->updateActions(currentState());
|
||||
m_gerritPlugin->addToLocator(m_commandLocator);
|
||||
|
||||
auto cmdContext = new QObject(this);
|
||||
connect(Core::ICore::instance(), &Core::ICore::coreOpened, cmdContext, [this, cmdContext, arguments] {
|
||||
remoteCommand(arguments, QDir::currentPath(), {});
|
||||
cmdContext->deleteLater();
|
||||
});
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
GitVersionControl *GitPlugin::gitVersionControl() const
|
||||
GitVersionControl *GitPluginPrivate::gitVersionControl() const
|
||||
{
|
||||
return static_cast<GitVersionControl *>(versionControl());
|
||||
}
|
||||
|
||||
void GitPlugin::diffCurrentFile()
|
||||
void GitPluginPrivate::diffCurrentFile()
|
||||
{
|
||||
const VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasFile(), return);
|
||||
m_gitClient->diffFile(state.currentFileTopLevel(), state.relativeCurrentFile());
|
||||
}
|
||||
|
||||
void GitPlugin::diffCurrentProject()
|
||||
void GitPluginPrivate::diffCurrentProject()
|
||||
{
|
||||
const VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasProject(), return);
|
||||
@@ -694,14 +707,14 @@ void GitPlugin::diffCurrentProject()
|
||||
m_gitClient->diffProject(state.currentProjectTopLevel(), relativeProject);
|
||||
}
|
||||
|
||||
void GitPlugin::logFile()
|
||||
void GitPluginPrivate::logFile()
|
||||
{
|
||||
const VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasFile(), return);
|
||||
m_gitClient->log(state.currentFileTopLevel(), state.relativeCurrentFile(), true);
|
||||
}
|
||||
|
||||
void GitPlugin::blameFile()
|
||||
void GitPluginPrivate::blameFile()
|
||||
{
|
||||
const VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasFile(), return);
|
||||
@@ -740,21 +753,21 @@ void GitPlugin::blameFile()
|
||||
editor->setFirstLineNumber(firstLine);
|
||||
}
|
||||
|
||||
void GitPlugin::logProject()
|
||||
void GitPluginPrivate::logProject()
|
||||
{
|
||||
const VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasProject(), return);
|
||||
m_gitClient->log(state.currentProjectTopLevel(), state.relativeCurrentProject());
|
||||
}
|
||||
|
||||
void GitPlugin::logRepository()
|
||||
void GitPluginPrivate::logRepository()
|
||||
{
|
||||
const VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasTopLevel(), return);
|
||||
m_gitClient->log(state.topLevel());
|
||||
}
|
||||
|
||||
void GitPlugin::undoFileChanges(bool revertStaging)
|
||||
void GitPluginPrivate::undoFileChanges(bool revertStaging)
|
||||
{
|
||||
if (IDocument *document = EditorManager::currentDocument()) {
|
||||
if (!DocumentManager::saveModifiedDocumentSilently(document))
|
||||
@@ -793,7 +806,7 @@ protected:
|
||||
}
|
||||
};
|
||||
|
||||
void GitPlugin::resetRepository()
|
||||
void GitPluginPrivate::resetRepository()
|
||||
{
|
||||
if (!DocumentManager::saveAllModifiedDocuments())
|
||||
return;
|
||||
@@ -808,7 +821,7 @@ void GitPlugin::resetRepository()
|
||||
m_gitClient->reset(topLevel, dialog.resetFlag(), dialog.commit());
|
||||
}
|
||||
|
||||
void GitPlugin::recoverDeletedFiles()
|
||||
void GitPluginPrivate::recoverDeletedFiles()
|
||||
{
|
||||
if (!DocumentManager::saveAllModifiedDocuments())
|
||||
return;
|
||||
@@ -817,7 +830,7 @@ void GitPlugin::recoverDeletedFiles()
|
||||
m_gitClient->recoverDeletedFiles(state.topLevel());
|
||||
}
|
||||
|
||||
void GitPlugin::startRebase()
|
||||
void GitPluginPrivate::startRebase()
|
||||
{
|
||||
const VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasTopLevel(), return);
|
||||
@@ -826,7 +839,7 @@ void GitPlugin::startRebase()
|
||||
startRebaseFromCommit(topLevel, QString());
|
||||
}
|
||||
|
||||
void GitPlugin::startRebaseFromCommit(const QString &workingDirectory, QString commit)
|
||||
void GitPluginPrivate::startRebaseFromCommit(const QString &workingDirectory, QString commit)
|
||||
{
|
||||
if (!DocumentManager::saveAllModifiedDocuments())
|
||||
return;
|
||||
@@ -846,7 +859,7 @@ void GitPlugin::startRebaseFromCommit(const QString &workingDirectory, QString c
|
||||
m_gitClient->interactiveRebase(workingDirectory, commit, false);
|
||||
}
|
||||
|
||||
void GitPlugin::startChangeRelatedAction(const Id &id)
|
||||
void GitPluginPrivate::startChangeRelatedAction(const Id &id)
|
||||
{
|
||||
const VcsBasePluginState state = currentState();
|
||||
|
||||
@@ -890,28 +903,28 @@ void GitPlugin::startChangeRelatedAction(const Id &id)
|
||||
}
|
||||
}
|
||||
|
||||
void GitPlugin::stageFile()
|
||||
void GitPluginPrivate::stageFile()
|
||||
{
|
||||
const VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasFile(), return);
|
||||
m_gitClient->addFile(state.currentFileTopLevel(), state.relativeCurrentFile());
|
||||
}
|
||||
|
||||
void GitPlugin::unstageFile()
|
||||
void GitPluginPrivate::unstageFile()
|
||||
{
|
||||
const VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasFile(), return);
|
||||
m_gitClient->synchronousReset(state.currentFileTopLevel(), {state.relativeCurrentFile()});
|
||||
}
|
||||
|
||||
void GitPlugin::gitkForCurrentFile()
|
||||
void GitPluginPrivate::gitkForCurrentFile()
|
||||
{
|
||||
const VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasFile(), return);
|
||||
m_gitClient->launchGitK(state.currentFileTopLevel(), state.relativeCurrentFile());
|
||||
}
|
||||
|
||||
void GitPlugin::gitkForCurrentFolder()
|
||||
void GitPluginPrivate::gitkForCurrentFolder()
|
||||
{
|
||||
const VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasFile(), return);
|
||||
@@ -941,14 +954,14 @@ void GitPlugin::gitkForCurrentFolder()
|
||||
}
|
||||
}
|
||||
|
||||
void GitPlugin::gitGui()
|
||||
void GitPluginPrivate::gitGui()
|
||||
{
|
||||
const VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasTopLevel(), return);
|
||||
m_gitClient->launchGitGui(state.topLevel());
|
||||
}
|
||||
|
||||
void GitPlugin::startCommit(CommitType commitType)
|
||||
void GitPluginPrivate::startCommit(CommitType commitType)
|
||||
{
|
||||
if (!promptBeforeCommit())
|
||||
return;
|
||||
@@ -987,7 +1000,7 @@ void GitPlugin::startCommit(CommitType commitType)
|
||||
openSubmitEditor(m_commitMessageFileName, data);
|
||||
}
|
||||
|
||||
void GitPlugin::updateVersionWarning()
|
||||
void GitPluginPrivate::updateVersionWarning()
|
||||
{
|
||||
unsigned version = m_gitClient->gitVersion();
|
||||
if (!version || version >= minimumRequiredVersion)
|
||||
@@ -1005,7 +1018,7 @@ void GitPlugin::updateVersionWarning()
|
||||
InfoBarEntry::GlobalSuppression::Enabled));
|
||||
}
|
||||
|
||||
IEditor *GitPlugin::openSubmitEditor(const QString &fileName, const CommitData &cd)
|
||||
IEditor *GitPluginPrivate::openSubmitEditor(const QString &fileName, const CommitData &cd)
|
||||
{
|
||||
IEditor *editor = EditorManager::openEditor(fileName, Constants::GITSUBMITEDITOR_ID);
|
||||
auto submitEditor = qobject_cast<GitSubmitEditor*>(editor);
|
||||
@@ -1030,7 +1043,7 @@ IEditor *GitPlugin::openSubmitEditor(const QString &fileName, const CommitData &
|
||||
return editor;
|
||||
}
|
||||
|
||||
void GitPlugin::commitFromEditor()
|
||||
void GitPluginPrivate::commitFromEditor()
|
||||
{
|
||||
// Close the submit editor
|
||||
m_submitActionTriggered = true;
|
||||
@@ -1038,7 +1051,7 @@ void GitPlugin::commitFromEditor()
|
||||
EditorManager::closeDocument(submitEditor()->document());
|
||||
}
|
||||
|
||||
bool GitPlugin::submitEditorAboutToClose()
|
||||
bool GitPluginPrivate::submitEditorAboutToClose()
|
||||
{
|
||||
if (!isCommitEditorOpen())
|
||||
return true;
|
||||
@@ -1096,7 +1109,7 @@ bool GitPlugin::submitEditorAboutToClose()
|
||||
if (editor->panelData().pushAction == NormalPush) {
|
||||
m_gitClient->push(m_submitRepository);
|
||||
} else if (editor->panelData().pushAction == PushToGerrit) {
|
||||
connect(editor, &QObject::destroyed, this, &GitPlugin::delayedPushToGerrit,
|
||||
connect(editor, &QObject::destroyed, this, &GitPluginPrivate::delayedPushToGerrit,
|
||||
Qt::QueuedConnection);
|
||||
}
|
||||
}
|
||||
@@ -1104,12 +1117,12 @@ bool GitPlugin::submitEditorAboutToClose()
|
||||
return true;
|
||||
}
|
||||
|
||||
void GitPlugin::fetch()
|
||||
void GitPluginPrivate::fetch()
|
||||
{
|
||||
m_gitClient->fetch(currentState().topLevel(), QString());
|
||||
}
|
||||
|
||||
void GitPlugin::pull()
|
||||
void GitPluginPrivate::pull()
|
||||
{
|
||||
if (!DocumentManager::saveAllModifiedDocuments())
|
||||
return;
|
||||
@@ -1132,21 +1145,21 @@ void GitPlugin::pull()
|
||||
m_gitClient->pull(topLevel, rebase);
|
||||
}
|
||||
|
||||
void GitPlugin::push()
|
||||
void GitPluginPrivate::push()
|
||||
{
|
||||
const VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasTopLevel(), return);
|
||||
m_gitClient->push(state.topLevel());
|
||||
}
|
||||
|
||||
void GitPlugin::startMergeTool()
|
||||
void GitPluginPrivate::startMergeTool()
|
||||
{
|
||||
const VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasTopLevel(), return);
|
||||
m_gitClient->merge(state.topLevel());
|
||||
}
|
||||
|
||||
void GitPlugin::continueOrAbortCommand()
|
||||
void GitPluginPrivate::continueOrAbortCommand()
|
||||
{
|
||||
if (!DocumentManager::saveAllModifiedDocuments())
|
||||
return;
|
||||
@@ -1174,21 +1187,21 @@ void GitPlugin::continueOrAbortCommand()
|
||||
updateContinueAndAbortCommands();
|
||||
}
|
||||
|
||||
void GitPlugin::cleanProject()
|
||||
void GitPluginPrivate::cleanProject()
|
||||
{
|
||||
const VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasProject(), return);
|
||||
cleanRepository(state.currentProjectPath());
|
||||
}
|
||||
|
||||
void GitPlugin::cleanRepository()
|
||||
void GitPluginPrivate::cleanRepository()
|
||||
{
|
||||
const VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasTopLevel(), return);
|
||||
cleanRepository(state.topLevel());
|
||||
}
|
||||
|
||||
void GitPlugin::cleanRepository(const QString &directory)
|
||||
void GitPluginPrivate::cleanRepository(const QString &directory)
|
||||
{
|
||||
// Find files to be deleted
|
||||
QString errorMessage;
|
||||
@@ -1214,7 +1227,7 @@ void GitPlugin::cleanRepository(const QString &directory)
|
||||
dialog.exec();
|
||||
}
|
||||
|
||||
void GitPlugin::updateSubmodules()
|
||||
void GitPluginPrivate::updateSubmodules()
|
||||
{
|
||||
const VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasTopLevel(), return);
|
||||
@@ -1227,7 +1240,7 @@ static bool ensureFileSaved(const QString &fileName)
|
||||
return DocumentManager::saveModifiedDocument(DocumentModel::documentForFilePath(fileName));
|
||||
}
|
||||
|
||||
void GitPlugin::applyCurrentFilePatch()
|
||||
void GitPluginPrivate::applyCurrentFilePatch()
|
||||
{
|
||||
const VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasPatchFile() && state.hasTopLevel(), return);
|
||||
@@ -1237,14 +1250,14 @@ void GitPlugin::applyCurrentFilePatch()
|
||||
applyPatch(state.topLevel(), patchFile);
|
||||
}
|
||||
|
||||
void GitPlugin::promptApplyPatch()
|
||||
void GitPluginPrivate::promptApplyPatch()
|
||||
{
|
||||
const VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasTopLevel(), return);
|
||||
applyPatch(state.topLevel(), QString());
|
||||
}
|
||||
|
||||
void GitPlugin::applyPatch(const QString &workingDirectory, QString file)
|
||||
void GitPluginPrivate::applyPatch(const QString &workingDirectory, QString file)
|
||||
{
|
||||
// Ensure user has been notified about pending changes
|
||||
if (!m_gitClient->beginStashScope(workingDirectory, "Apply-Patch", AllowUnstashed))
|
||||
@@ -1271,7 +1284,7 @@ void GitPlugin::applyPatch(const QString &workingDirectory, QString file)
|
||||
m_gitClient->endStashScope(workingDirectory);
|
||||
}
|
||||
|
||||
void GitPlugin::stash(bool unstagedOnly)
|
||||
void GitPluginPrivate::stash(bool unstagedOnly)
|
||||
{
|
||||
if (!DocumentManager::saveAllModifiedDocuments())
|
||||
return;
|
||||
@@ -1285,12 +1298,12 @@ void GitPlugin::stash(bool unstagedOnly)
|
||||
m_stashDialog->refresh(topLevel, true);
|
||||
}
|
||||
|
||||
void GitPlugin::stashUnstaged()
|
||||
void GitPluginPrivate::stashUnstaged()
|
||||
{
|
||||
stash(true);
|
||||
}
|
||||
|
||||
void GitPlugin::stashSnapshot()
|
||||
void GitPluginPrivate::stashSnapshot()
|
||||
{
|
||||
// Prompt for description, restore immediately and keep on working.
|
||||
const VcsBasePluginState state = currentState();
|
||||
@@ -1301,7 +1314,7 @@ void GitPlugin::stashSnapshot()
|
||||
m_stashDialog->refresh(state.topLevel(), true);
|
||||
}
|
||||
|
||||
void GitPlugin::stashPop()
|
||||
void GitPluginPrivate::stashPop()
|
||||
{
|
||||
if (!DocumentManager::saveAllModifiedDocuments())
|
||||
return;
|
||||
@@ -1326,28 +1339,28 @@ template <class NonModalDialog>
|
||||
}
|
||||
}
|
||||
|
||||
void GitPlugin::branchList()
|
||||
void GitPluginPrivate::branchList()
|
||||
{
|
||||
ModeManager::activateMode(Core::Constants::MODE_EDIT);
|
||||
NavigationWidget::activateSubWidget(Constants::GIT_BRANCH_VIEW_ID, Side::Right);
|
||||
}
|
||||
|
||||
void GitPlugin::manageRemotes()
|
||||
void GitPluginPrivate::manageRemotes()
|
||||
{
|
||||
showNonModalDialog(currentState().topLevel(), m_remoteDialog);
|
||||
}
|
||||
|
||||
void GitPlugin::initRepository()
|
||||
void GitPluginPrivate::initRepository()
|
||||
{
|
||||
createRepository();
|
||||
}
|
||||
|
||||
void GitPlugin::stashList()
|
||||
void GitPluginPrivate::stashList()
|
||||
{
|
||||
showNonModalDialog(currentState().topLevel(), m_stashDialog);
|
||||
}
|
||||
|
||||
void GitPlugin::updateActions(VcsBasePlugin::ActionState as)
|
||||
void GitPluginPrivate::updateActions(VcsBasePluginPrivate::ActionState as)
|
||||
{
|
||||
const VcsBasePluginState state = currentState();
|
||||
const bool repositoryEnabled = state.hasTopLevel();
|
||||
@@ -1386,7 +1399,7 @@ void GitPlugin::updateActions(VcsBasePlugin::ActionState as)
|
||||
m_gerritPlugin->updateActions(state);
|
||||
}
|
||||
|
||||
void GitPlugin::updateContinueAndAbortCommands()
|
||||
void GitPluginPrivate::updateContinueAndAbortCommands()
|
||||
{
|
||||
if (currentState().hasTopLevel()) {
|
||||
GitClient::CommandInProgress gitCommandInProgress =
|
||||
@@ -1419,18 +1432,18 @@ void GitPlugin::updateContinueAndAbortCommands()
|
||||
}
|
||||
}
|
||||
|
||||
void GitPlugin::delayedPushToGerrit()
|
||||
void GitPluginPrivate::delayedPushToGerrit()
|
||||
{
|
||||
m_gerritPlugin->push(m_submitRepository);
|
||||
}
|
||||
|
||||
void GitPlugin::updateBranches(const QString &repository)
|
||||
void GitPluginPrivate::updateBranches(const QString &repository)
|
||||
{
|
||||
if (m_branchViewFactory && m_branchViewFactory->view())
|
||||
m_branchViewFactory->view()->refreshIfSame(repository);
|
||||
}
|
||||
|
||||
void GitPlugin::updateCurrentBranch()
|
||||
void GitPluginPrivate::updateCurrentBranch()
|
||||
{
|
||||
if (m_branchViewFactory && m_branchViewFactory->view())
|
||||
m_branchViewFactory->view()->refreshCurrentBranch();
|
||||
@@ -1439,15 +1452,15 @@ void GitPlugin::updateCurrentBranch()
|
||||
QObject *GitPlugin::remoteCommand(const QStringList &options, const QString &workingDirectory,
|
||||
const QStringList &)
|
||||
{
|
||||
if (!m_gitClient || options.size() < 2)
|
||||
if (!GitPluginPrivate::client() || options.size() < 2)
|
||||
return nullptr;
|
||||
|
||||
if (options.first() == "-git-show")
|
||||
m_gitClient->show(workingDirectory, options.at(1));
|
||||
GitPluginPrivate::client()->show(workingDirectory, options.at(1));
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void GitPlugin::updateRepositoryBrowserAction()
|
||||
void GitPluginPrivate::updateRepositoryBrowserAction()
|
||||
{
|
||||
const bool repositoryEnabled = currentState().hasTopLevel();
|
||||
const bool hasRepositoryBrowserCmd
|
||||
@@ -1455,7 +1468,7 @@ void GitPlugin::updateRepositoryBrowserAction()
|
||||
m_repositoryBrowserAction->setEnabled(repositoryEnabled && hasRepositoryBrowserCmd);
|
||||
}
|
||||
|
||||
Gerrit::Internal::GerritPlugin *GitPlugin::gerritPlugin() const
|
||||
Gerrit::Internal::GerritPlugin *GitPluginPrivate::gerritPlugin() const
|
||||
{
|
||||
return m_gerritPlugin;
|
||||
}
|
||||
|
Reference in New Issue
Block a user