forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -77,15 +77,13 @@ bool ClangFormat::initialize()
|
||||
m_formatFile = new QAction(BeautifierPlugin::msgFormatCurrentFile(), this);
|
||||
Core::Command *cmd
|
||||
= Core::ActionManager::registerAction(m_formatFile,
|
||||
Constants::ClangFormat::ACTION_FORMATFILE,
|
||||
Core::Context(Core::Constants::C_GLOBAL));
|
||||
Constants::ClangFormat::ACTION_FORMATFILE);
|
||||
menu->addAction(cmd);
|
||||
connect(m_formatFile, &QAction::triggered, this, &ClangFormat::formatFile);
|
||||
|
||||
m_formatRange = new QAction(BeautifierPlugin::msgFormatSelectedText(), this);
|
||||
cmd = Core::ActionManager::registerAction(m_formatRange,
|
||||
Constants::ClangFormat::ACTION_FORMATSELECTED,
|
||||
Core::Context(Core::Constants::C_GLOBAL));
|
||||
Constants::ClangFormat::ACTION_FORMATSELECTED);
|
||||
menu->addAction(cmd);
|
||||
connect(m_formatRange, &QAction::triggered, this, &ClangFormat::formatSelectedText);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user