diff --git a/src/plugins/git/gerrit/gerritplugin.cpp b/src/plugins/git/gerrit/gerritplugin.cpp index f24384a20ef..f1deaa2a07f 100644 --- a/src/plugins/git/gerrit/gerritplugin.cpp +++ b/src/plugins/git/gerrit/gerritplugin.cpp @@ -276,11 +276,11 @@ bool GerritPlugin::initialize(Core::ActionContainer *ac) QAction *openViewAction = new QAction(tr("Gerrit..."), this); - Core::Command *command = + m_gerritCommand = Core::ActionManager::registerAction(openViewAction, Constants::GERRIT_OPEN_VIEW, Core::Context(Core::Constants::C_GLOBAL)); connect(openViewAction, SIGNAL(triggered()), this, SLOT(openView())); - ac->addAction(command); + ac->addAction(m_gerritCommand); QAction *pushAction = new QAction(tr("Push to Gerrit..."), this); @@ -303,6 +303,7 @@ void GerritPlugin::updateActions(bool hasTopLevel) void GerritPlugin::addToLocator(Locator::CommandLocator *locator) { + locator->appendCommand(m_gerritCommand); locator->appendCommand(m_pushToGerritPair.second); } diff --git a/src/plugins/git/gerrit/gerritplugin.h b/src/plugins/git/gerrit/gerritplugin.h index aafb083dbd4..4eda51bd989 100644 --- a/src/plugins/git/gerrit/gerritplugin.h +++ b/src/plugins/git/gerrit/gerritplugin.h @@ -88,6 +88,7 @@ private: QSharedPointer m_parameters; QPointer m_dialog; + Core::Command *m_gerritCommand; ActionCommandPair m_pushToGerritPair; QString m_reviewers; };