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/subversion | |
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/subversion')
-rw-r--r-- | src/plugins/subversion/subversionplugin.cpp | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp index a9763654d9..61438db11d 100644 --- a/src/plugins/subversion/subversionplugin.cpp +++ b/src/plugins/subversion/subversionplugin.cpp @@ -88,18 +88,14 @@ static const char CMD_ID_SUBVERSION_MENU[] = "Subversion.Menu"; static const char CMD_ID_ADD[] = "Subversion.Add"; static const char CMD_ID_DELETE_FILE[] = "Subversion.Delete"; static const char CMD_ID_REVERT[] = "Subversion.Revert"; -static const char CMD_ID_SEPARATOR0[] = "Subversion.Separator0"; static const char CMD_ID_DIFF_PROJECT[] = "Subversion.DiffAll"; static const char CMD_ID_DIFF_CURRENT[] = "Subversion.DiffCurrent"; -static const char CMD_ID_SEPARATOR1[] = "Subversion.Separator1"; static const char CMD_ID_COMMIT_ALL[] = "Subversion.CommitAll"; static const char CMD_ID_REVERT_ALL[] = "Subversion.RevertAll"; static const char CMD_ID_COMMIT_CURRENT[] = "Subversion.CommitCurrent"; static const char CMD_ID_SEPARATOR2[] = "Subversion.Separator2"; static const char CMD_ID_FILELOG_CURRENT[] = "Subversion.FilelogCurrent"; static const char CMD_ID_ANNOTATE_CURRENT[] = "Subversion.AnnotateCurrent"; -static const char CMD_ID_SEPARATOR3[] = "Subversion.Separator3"; -static const char CMD_ID_SEPARATOR4[] = "Subversion.Separator4"; static const char CMD_ID_STATUS[] = "Subversion.Status"; static const char CMD_ID_PROJECTLOG[] = "Subversion.ProjectLog"; static const char CMD_ID_REPOSITORYLOG[] = "Subversion.RepositoryLog"; @@ -248,15 +244,6 @@ static const VcsBase::VcsBaseSubmitEditorParameters submitParameters = { Subversion::Constants::SUBVERSIONCOMMITEDITOR }; -static inline Core::Command *createSeparator(QObject *parent, - const char*id, - const Core::Context &globalcontext) -{ - QAction *tmpaction = new QAction(parent); - tmpaction->setSeparator(true); - return Core::ActionManager::registerAction(tmpaction, id, globalcontext); -} - bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *errorMessage) { typedef VcsBase::VcsSubmitEditorFactory<SubversionSubmitEditor> SubversionSubmitEditorFactory; @@ -330,7 +317,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e subversionMenu->addAction(command); m_commandLocator->appendCommand(command); - subversionMenu->addAction(createSeparator(this, CMD_ID_SEPARATOR0, globalcontext)); + subversionMenu->addSeparator(globalcontext); m_addAction = new Utils::ParameterAction(tr("Add"), tr("Add \"%1\""), Utils::ParameterAction::EnabledWithParameter, this); command = Core::ActionManager::registerAction(m_addAction, CMD_ID_ADD, @@ -366,7 +353,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e subversionMenu->addAction(command); m_commandLocator->appendCommand(command); - subversionMenu->addAction(createSeparator(this, CMD_ID_SEPARATOR1, globalcontext)); + subversionMenu->addSeparator(globalcontext); m_diffProjectAction = new Utils::ParameterAction(tr("Diff Project"), tr("Diff Project \"%1\""), Utils::ParameterAction::EnabledWithParameter, this); command = Core::ActionManager::registerAction(m_diffProjectAction, CMD_ID_DIFF_PROJECT, @@ -405,7 +392,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e subversionMenu->addAction(command); m_commandLocator->appendCommand(command); - subversionMenu->addAction(createSeparator(this, CMD_ID_SEPARATOR2, globalcontext)); + subversionMenu->addSeparator(globalcontext); m_diffRepositoryAction = new QAction(tr("Diff Repository"), this); command = Core::ActionManager::registerAction(m_diffRepositoryAction, CMD_ID_REPOSITORYDIFF, globalcontext); |