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

@@ -204,12 +204,9 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *
msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD);
connect(m_runQMakeActionContextMenu, SIGNAL(triggered()), m_qt4ProjectManager, SLOT(runQMakeContextMenu()));
m_subProjectRebuildSeparator = new QAction(this);
m_subProjectRebuildSeparator->setSeparator(true);
command = msubproject->addSeparator(projectContext, ProjectExplorer::Constants::G_PROJECT_BUILD,
&m_subProjectRebuildSeparator);
command->setAttribute(Core::Command::CA_Hide);
command = Core::ActionManager::registerAction(
m_subProjectRebuildSeparator, Core::Id("ProjectExplorer.SubprojectRebuild.Sep"), projectContext);
msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD);
m_rebuildSubProjectContextMenu = new QAction(tr("Rebuild"), this);
command = Core::ActionManager::registerAction(
@@ -303,10 +300,7 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *
mproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_FILES);
msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_FILES);
QAction *separator = new QAction(this);
separator->setSeparator(true);
contextMenu->addAction(Core::ActionManager::registerAction(separator,
Core::Id(Constants::SEPARATOR), proFileEditorContext));
contextMenu->addSeparator(proFileEditorContext);
command = Core::ActionManager::command(TextEditor::Constants::UN_COMMENT_SELECTION);
contextMenu->addAction(command);