Add ActionContainer::addSeparator(...)

Gets rid of a lot of code duplication.

Change-Id: I2ce38fb38a0b61cb821e0bdc7bcc9a7ccdf9da72
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Eike Ziller
2012-06-05 14:22:20 +02:00
committed by hjk
parent d90264d6c2
commit cdd44befff
34 changed files with 132 additions and 394 deletions

View File

@@ -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)) {