diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 39ed9de94ae..261e4c91f93 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -249,13 +249,11 @@ QAction *GitPlugin::createRepositoryAction(ActionContainer *ac, return action; } -QAction *GitPlugin::createChangeRelatedRepositoryAction(ActionContainer *ac, - const QString &text, Id id, - const Context &context, bool addToLocator, - const QKeySequence &keys) +QAction *GitPlugin::createChangeRelatedRepositoryAction(const QString &text, Id id, + const Context &context) { - return createRepositoryAction(ac, text, id, context, addToLocator, - [this, id] { startChangeRelatedAction(id); }, keys); + return createRepositoryAction(nullptr, text, id, context, true, + [this, id] { startChangeRelatedAction(id); }, QKeySequence()); } // Action to act on the repository forwarded to a git client member function @@ -546,17 +544,10 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage) // -------------- /* Actions only in locator */ - createChangeRelatedRepositoryAction(0, tr("Show..."), "Git.Show", - context, true); - - createChangeRelatedRepositoryAction(0, tr("Revert..."), "Git.Revert", - context, true); - - createChangeRelatedRepositoryAction(0, tr("Cherry Pick..."), "Git.CherryPick", - context, true); - - createChangeRelatedRepositoryAction(0, tr("Checkout..."), "Git.Checkout", - context, true); + createChangeRelatedRepositoryAction(tr("Show..."), "Git.Show", context); + createChangeRelatedRepositoryAction(tr("Revert..."), "Git.Revert", context); + createChangeRelatedRepositoryAction(tr("Cherry Pick..."), "Git.CherryPick", context); + createChangeRelatedRepositoryAction(tr("Checkout..."), "Git.Checkout", context); createRepositoryAction(0, tr("Rebase..."), "Git.Rebase", context, true, [this] { branchList(); }); createRepositoryAction(0, tr("Merge..."), "Git.Merge", context, true, [this] { branchList(); }); diff --git a/src/plugins/git/gitplugin.h b/src/plugins/git/gitplugin.h index 4795d7e1955..35ab6346e22 100644 --- a/src/plugins/git/gitplugin.h +++ b/src/plugins/git/gitplugin.h @@ -176,15 +176,13 @@ private: const Core::Context &context, bool addToLocator, const std::function &callback, const QKeySequence &keys = QKeySequence()); - QAction *createChangeRelatedRepositoryAction(Core::ActionContainer *ac, - const QString &text, Core::Id id, - const Core::Context &context, - bool addToLocator, - const QKeySequence &keys = QKeySequence()); QAction *createRepositoryAction(Core::ActionContainer *ac, const QString &text, Core::Id id, const Core::Context &context, bool addToLocator, GitClientMemberFunc, const QKeySequence &keys = QKeySequence()); + QAction *createChangeRelatedRepositoryAction(const QString &text, Core::Id id, + const Core::Context &context); + void updateRepositoryBrowserAction(); bool isCommitEditorOpen() const; Core::IEditor *openSubmitEditor(const QString &fileName, const CommitData &cd);