diff options
author | hjk <hjk@theqtcompany.com> | 2015-02-19 11:35:47 +0100 |
---|---|---|
committer | hjk <hjk@theqtcompany.com> | 2015-02-26 10:09:03 +0000 |
commit | 7f001dab1b9dd05160e78adb0554ad3478ba363c (patch) | |
tree | 6d4dcafbd9ded333eb6e971bb70af17b36f5cae2 /src/plugins/analyzerbase/analyzermanager.cpp | |
parent | 5b8046305028f936cc00aa3e4a9a31a64f6776fe (diff) | |
download | qt-creator-7f001dab1b9dd05160e78adb0554ad3478ba363c.tar.gz |
Core: Make Context parameter to registerAction optional
... and default to C_GLOBAL. A rather common case.
Similar for ActionContainer::addSeparator().
Change-Id: I7f9ba573af201c0a472132d5a494ad17cc4175b7
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Diffstat (limited to 'src/plugins/analyzerbase/analyzermanager.cpp')
-rw-r--r-- | src/plugins/analyzerbase/analyzermanager.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/plugins/analyzerbase/analyzermanager.cpp b/src/plugins/analyzerbase/analyzermanager.cpp index 63be4faeff..60adec51e6 100644 --- a/src/plugins/analyzerbase/analyzermanager.cpp +++ b/src/plugins/analyzerbase/analyzermanager.cpp @@ -216,7 +216,6 @@ AnalyzerManagerPrivate::~AnalyzerManagerPrivate() void AnalyzerManagerPrivate::setupActions() { - const Context globalcontext(C_GLOBAL); Command *command = 0; // Menus @@ -235,15 +234,16 @@ void AnalyzerManagerPrivate::setupActions() m_startAction = new QAction(tr("Start"), m_menu); m_startAction->setIcon(QIcon(QLatin1String(ANALYZER_CONTROL_START_ICON))); - ActionManager::registerAction(m_startAction, "Analyzer.Start", globalcontext); + ActionManager::registerAction(m_startAction, "Analyzer.Start"); connect(m_startAction, &QAction::triggered, this, &AnalyzerManagerPrivate::startTool); m_stopAction = new QAction(tr("Stop"), m_menu); m_stopAction->setEnabled(false); m_stopAction->setIcon(QIcon(QLatin1String(ANALYZER_CONTROL_STOP_ICON))); - command = ActionManager::registerAction(m_stopAction, "Analyzer.Stop", globalcontext); + command = ActionManager::registerAction(m_stopAction, "Analyzer.Stop"); m_menu->addAction(command, G_ANALYZER_CONTROL); + const Context globalcontext(C_GLOBAL); m_menu->addSeparator(globalcontext, G_ANALYZER_TOOLS); m_menu->addSeparator(globalcontext, G_ANALYZER_REMOTE_TOOLS); m_menu->addSeparator(globalcontext, G_ANALYZER_OPTIONS); @@ -377,12 +377,10 @@ void AnalyzerManagerPrivate::activateDock(Qt::DockWidgetArea area, QDockWidget * dockWidget->setParent(m_mainWindow); m_mainWindow->addDockWidget(area, dockWidget); - Context globalContext(C_GLOBAL); - QAction *toggleViewAction = dockWidget->toggleViewAction(); toggleViewAction->setText(dockWidget->windowTitle()); Command *cmd = ActionManager::registerAction(toggleViewAction, - Id("Analyzer.").withSuffix(dockWidget->objectName()), globalContext); + Id("Analyzer.").withSuffix(dockWidget->objectName())); cmd->setAttribute(Command::CA_Hide); ActionContainer *viewsMenu = ActionManager::actionContainer(Id(M_WINDOW_VIEWS)); @@ -525,7 +523,7 @@ void AnalyzerManagerPrivate::addAction(AnalyzerAction *action) Id menuGroup = action->menuGroup(); if (menuGroup.isValid()) { - Command *command = ActionManager::registerAction(action, action->actionId(), Context(C_GLOBAL)); + Command *command = ActionManager::registerAction(action, action->actionId()); m_menu->addAction(command, menuGroup); } |