From cdd44befff713e99018a92a78aea460504477dce Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 5 Jun 2012 14:22:20 +0200 Subject: Add ActionContainer::addSeparator(...) Gets rid of a lot of code duplication. Change-Id: I2ce38fb38a0b61cb821e0bdc7bcc9a7ccdf9da72 Reviewed-by: hjk --- src/plugins/bazaar/bazaarplugin.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'src/plugins/bazaar/bazaarplugin.cpp') diff --git a/src/plugins/bazaar/bazaarplugin.cpp b/src/plugins/bazaar/bazaarplugin.cpp index 79f3fcbede..6b37ebdf01 100644 --- a/src/plugins/bazaar/bazaarplugin.cpp +++ b/src/plugins/bazaar/bazaarplugin.cpp @@ -217,11 +217,11 @@ void BazaarPlugin::createMenu() menu->setTitle(tr("Bazaar")); createFileActions(context); - createSeparator(context, Core::Id("Bazaar.FileDirSeperator")); + m_bazaarContainer->addSeparator(context); createDirectoryActions(context); - createSeparator(context, Core::Id("Bazaar.DirRepoSeperator")); + m_bazaarContainer->addSeparator(context); createRepositoryActions(context); - createSeparator(context, Core::Id("Bazaar.Repository Management")); + m_bazaarContainer->addSeparator(context); // Request the Tools menu and add the Bazaar menu to it Core::ActionContainer *toolsMenu = Core::ActionManager::actionContainer(Core::Id(Core::Constants::M_TOOLS)); @@ -264,7 +264,7 @@ void BazaarPlugin::createFileActions(const Core::Context &context) m_bazaarContainer->addAction(command); m_commandLocator->appendCommand(command); - createSeparator(context, Core::Id("Bazaar.FileDirSeperator1")); + m_bazaarContainer->addSeparator(context); m_addAction = new Utils::ParameterAction(tr("Add"), tr("Add \"%1\""), Utils::ParameterAction::EnabledWithParameter, this); command = Core::ActionManager::registerAction(m_addAction, Core::Id(Constants::ADD), context); @@ -676,13 +676,6 @@ void BazaarPlugin::deleteCommitLog() } } -void BazaarPlugin::createSeparator(const Core::Context &context, const Core::Id &id) -{ - QAction *action = new QAction(this); - action->setSeparator(true); - m_bazaarContainer->addAction(Core::ActionManager::registerAction(action, id, context)); -} - void BazaarPlugin::updateActions(VcsBase::VcsBasePlugin::ActionState as) { if (!enableMenuAction(as, m_menuAction)) { -- cgit v1.2.1