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:
@@ -160,11 +160,9 @@ bool DiffEditorPlugin::initialize(const QStringList &arguments, QString *errorMe
|
||||
toolsContainer->insertGroup(Core::Constants::G_TOOLS_OPTIONS,
|
||||
Constants::G_TOOLS_DIFF);
|
||||
|
||||
Core::Context globalcontext(Core::Constants::C_GLOBAL);
|
||||
|
||||
QAction *diffAction = new QAction(tr("Diff..."), this);
|
||||
Core::Command *diffCommand = Core::ActionManager::registerAction(diffAction,
|
||||
"DiffEditor.Diff", globalcontext);
|
||||
"DiffEditor.Diff");
|
||||
connect(diffAction, &QAction::triggered, this, &DiffEditorPlugin::diff);
|
||||
toolsContainer->addAction(diffCommand, Constants::G_TOOLS_DIFF);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user