summaryrefslogtreecommitdiff
path: root/src/plugins/perforce
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@nokia.com>2012-06-05 14:22:20 +0200
committerhjk <qthjk@ovi.com>2012-06-05 15:19:30 +0200
commitcdd44befff713e99018a92a78aea460504477dce (patch)
tree41c43f4db7a326370bc20a1c6e2707b8ccf36166 /src/plugins/perforce
parentd90264d6c2a7f9e53863de98145774727ea64e58 (diff)
downloadqt-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/perforce')
-rw-r--r--src/plugins/perforce/perforceplugin.cpp20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp
index a3909ced54..e8ad8010b6 100644
--- a/src/plugins/perforce/perforceplugin.cpp
+++ b/src/plugins/perforce/perforceplugin.cpp
@@ -162,9 +162,6 @@ static const char CMD_ID_ANNOTATE[] = "Perforce.Annotate";
static const char CMD_ID_FILELOG_CURRENT[] = "Perforce.FilelogCurrent";
static const char CMD_ID_FILELOG[] = "Perforce.Filelog";
static const char CMD_ID_UPDATEALL[] = "Perforce.UpdateAll";
-static const char CMD_ID_SEPARATOR1[] = "Perforce.Separator1";
-static const char CMD_ID_SEPARATOR2[] = "Perforce.Separator2";
-static const char CMD_ID_SEPARATOR3[] = "Perforce.Separator3";
////
// PerforcePlugin
@@ -220,15 +217,6 @@ static const VcsBase::VcsBaseSubmitEditorParameters submitParameters = {
Perforce::Constants::PERFORCESUBMITEDITOR_CONTEXT
};
-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 PerforcePlugin::initialize(const QStringList & /* arguments */, QString *errorMessage)
{
typedef VcsBase::VcsEditorFactory<PerforceEditor> PerforceEditorFactory;
@@ -296,7 +284,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
mperforce->addAction(command);
m_commandLocator->appendCommand(command);
- mperforce->addAction(createSeparator(this, "Perforce.Sep.Edit", globalcontext));
+ mperforce->addSeparator(globalcontext);
m_editAction = new Utils::ParameterAction(tr("Edit"), tr("Edit \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
command = Core::ActionManager::registerAction(m_editAction, CMD_ID_EDIT, globalcontext);
@@ -333,7 +321,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
mperforce->addAction(command);
m_commandLocator->appendCommand(command);
- mperforce->addAction(createSeparator(this, "Perforce.Sep.Project", globalcontext));
+ mperforce->addSeparator(globalcontext);
const QString diffProjectDefaultText = tr("Diff Current Project/Session");
m_diffProjectAction = new Utils::ParameterAction(diffProjectDefaultText, tr("Diff Project \"%1\""), Utils::ParameterAction::AlwaysEnabled, this);
@@ -383,7 +371,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
mperforce->addAction(command);
m_commandLocator->appendCommand(command);
- mperforce->addAction(createSeparator(this, "Perforce.Sep.Repository", globalcontext));
+ mperforce->addSeparator(globalcontext);
m_diffAllAction = new QAction(tr("Diff Opened Files"), this);
command = Core::ActionManager::registerAction(m_diffAllAction, CMD_ID_DIFF_ALL, globalcontext);
@@ -416,7 +404,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
mperforce->addAction(command);
m_commandLocator->appendCommand(command);
- mperforce->addAction(createSeparator(this, "Perforce.Sep.Dialogs", globalcontext));
+ mperforce->addSeparator(globalcontext);
m_describeAction = new QAction(tr("Describe..."), this);
command = Core::ActionManager::registerAction(m_describeAction, CMD_ID_DESCRIBE, globalcontext);