forked from qt-creator/qt-creator
Git: Simplify createChangeRelatedRepositoryAction
Change-Id: I0d374b071b73565bb3e48b4a1f32bc7baf988a28 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -249,13 +249,11 @@ QAction *GitPlugin::createRepositoryAction(ActionContainer *ac,
|
|||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
|
|
||||||
QAction *GitPlugin::createChangeRelatedRepositoryAction(ActionContainer *ac,
|
QAction *GitPlugin::createChangeRelatedRepositoryAction(const QString &text, Id id,
|
||||||
const QString &text, Id id,
|
const Context &context)
|
||||||
const Context &context, bool addToLocator,
|
|
||||||
const QKeySequence &keys)
|
|
||||||
{
|
{
|
||||||
return createRepositoryAction(ac, text, id, context, addToLocator,
|
return createRepositoryAction(nullptr, text, id, context, true,
|
||||||
[this, id] { startChangeRelatedAction(id); }, keys);
|
[this, id] { startChangeRelatedAction(id); }, QKeySequence());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Action to act on the repository forwarded to a git client member function
|
// 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 */
|
/* Actions only in locator */
|
||||||
createChangeRelatedRepositoryAction(0, tr("Show..."), "Git.Show",
|
createChangeRelatedRepositoryAction(tr("Show..."), "Git.Show", context);
|
||||||
context, true);
|
createChangeRelatedRepositoryAction(tr("Revert..."), "Git.Revert", context);
|
||||||
|
createChangeRelatedRepositoryAction(tr("Cherry Pick..."), "Git.CherryPick", context);
|
||||||
createChangeRelatedRepositoryAction(0, tr("Revert..."), "Git.Revert",
|
createChangeRelatedRepositoryAction(tr("Checkout..."), "Git.Checkout", context);
|
||||||
context, true);
|
|
||||||
|
|
||||||
createChangeRelatedRepositoryAction(0, tr("Cherry Pick..."), "Git.CherryPick",
|
|
||||||
context, true);
|
|
||||||
|
|
||||||
createChangeRelatedRepositoryAction(0, tr("Checkout..."), "Git.Checkout",
|
|
||||||
context, true);
|
|
||||||
|
|
||||||
createRepositoryAction(0, tr("Rebase..."), "Git.Rebase", context, true, [this] { branchList(); });
|
createRepositoryAction(0, tr("Rebase..."), "Git.Rebase", context, true, [this] { branchList(); });
|
||||||
createRepositoryAction(0, tr("Merge..."), "Git.Merge", context, true, [this] { branchList(); });
|
createRepositoryAction(0, tr("Merge..."), "Git.Merge", context, true, [this] { branchList(); });
|
||||||
|
@@ -176,15 +176,13 @@ private:
|
|||||||
const Core::Context &context, bool addToLocator,
|
const Core::Context &context, bool addToLocator,
|
||||||
const std::function<void()> &callback,
|
const std::function<void()> &callback,
|
||||||
const QKeySequence &keys = QKeySequence());
|
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,
|
QAction *createRepositoryAction(Core::ActionContainer *ac, const QString &text, Core::Id id,
|
||||||
const Core::Context &context, bool addToLocator,
|
const Core::Context &context, bool addToLocator,
|
||||||
GitClientMemberFunc, const QKeySequence &keys = QKeySequence());
|
GitClientMemberFunc, const QKeySequence &keys = QKeySequence());
|
||||||
|
|
||||||
|
QAction *createChangeRelatedRepositoryAction(const QString &text, Core::Id id,
|
||||||
|
const Core::Context &context);
|
||||||
|
|
||||||
void updateRepositoryBrowserAction();
|
void updateRepositoryBrowserAction();
|
||||||
bool isCommitEditorOpen() const;
|
bool isCommitEditorOpen() const;
|
||||||
Core::IEditor *openSubmitEditor(const QString &fileName, const CommitData &cd);
|
Core::IEditor *openSubmitEditor(const QString &fileName, const CommitData &cd);
|
||||||
|
Reference in New Issue
Block a user