diff options
author | Eike Ziller <eike.ziller@nokia.com> | 2012-06-05 14:22:20 +0200 |
---|---|---|
committer | hjk <qthjk@ovi.com> | 2012-06-05 15:19:30 +0200 |
commit | cdd44befff713e99018a92a78aea460504477dce (patch) | |
tree | 41c43f4db7a326370bc20a1c6e2707b8ccf36166 /src/plugins/bazaar/bazaarplugin.cpp | |
parent | d90264d6c2a7f9e53863de98145774727ea64e58 (diff) | |
download | qt-creator-cdd44befff713e99018a92a78aea460504477dce.tar.gz |
Add ActionContainer::addSeparator(...)
Gets rid of a lot of code duplication.
Change-Id: I2ce38fb38a0b61cb821e0bdc7bcc9a7ccdf9da72
Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'src/plugins/bazaar/bazaarplugin.cpp')
-rw-r--r-- | src/plugins/bazaar/bazaarplugin.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
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)) { |