diff options
Diffstat (limited to 'src/plugins/glsleditor/glsleditorplugin.cpp')
-rw-r--r-- | src/plugins/glsleditor/glsleditorplugin.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/plugins/glsleditor/glsleditorplugin.cpp b/src/plugins/glsleditor/glsleditorplugin.cpp index cc1244b39d..856158a82a 100644 --- a/src/plugins/glsleditor/glsleditorplugin.cpp +++ b/src/plugins/glsleditor/glsleditorplugin.cpp @@ -107,14 +107,13 @@ GLSLEditorPlugin::~GLSLEditorPlugin() /*! Copied from cppplugin.cpp */ static inline -Core::Command *createSeparator(Core::ActionManager *am, - QObject *parent, +Core::Command *createSeparator(QObject *parent, Core::Context &context, const char *id) { QAction *separator = new QAction(parent); separator->setSeparator(true); - return am->registerAction(separator, Core::Id(id), context); + return Core::ActionManager::registerAction(separator, Core::Id(id), context); } bool GLSLEditorPlugin::initialize(const QStringList & /*arguments*/, QString *errorMessage) @@ -140,27 +139,26 @@ bool GLSLEditorPlugin::initialize(const QStringList & /*arguments*/, QString *er | TextEditor::TextEditorActionHandler::UnCollapseAll); m_actionHandler->initializeActions(); - Core::ActionManager *am = Core::ICore::actionManager(); - Core::ActionContainer *contextMenu = am->createMenu(GLSLEditor::Constants::M_CONTEXT); - Core::ActionContainer *glslToolsMenu = am->createMenu(Core::Id(Constants::M_TOOLS_GLSL)); + Core::ActionContainer *contextMenu = Core::ActionManager::createMenu(GLSLEditor::Constants::M_CONTEXT); + Core::ActionContainer *glslToolsMenu = Core::ActionManager::createMenu(Core::Id(Constants::M_TOOLS_GLSL)); glslToolsMenu->setOnAllDisabledBehavior(Core::ActionContainer::Hide); QMenu *menu = glslToolsMenu->menu(); //: GLSL sub-menu in the Tools menu menu->setTitle(tr("GLSL")); - am->actionContainer(Core::Constants::M_TOOLS)->addMenu(glslToolsMenu); + Core::ActionManager::actionContainer(Core::Constants::M_TOOLS)->addMenu(glslToolsMenu); Core::Command *cmd = 0; // Insert marker for "Refactoring" menu: Core::Context globalContext(Core::Constants::C_GLOBAL); - Core::Command *sep = createSeparator(am, this, globalContext, + Core::Command *sep = createSeparator(this, globalContext, Constants::SEPARATOR1); sep->action()->setObjectName(Constants::M_REFACTORING_MENU_INSERTION_POINT); contextMenu->addAction(sep); - contextMenu->addAction(createSeparator(am, this, globalContext, + contextMenu->addAction(createSeparator(this, globalContext, Constants::SEPARATOR2)); - cmd = am->command(TextEditor::Constants::UN_COMMENT_SELECTION); + cmd = Core::ActionManager::command(TextEditor::Constants::UN_COMMENT_SELECTION); contextMenu->addAction(cmd); errorMessage->clear(); @@ -244,11 +242,11 @@ void GLSLEditorPlugin::initializeEditor(GLSLEditor::GLSLTextEditorWidget *editor TextEditor::TextEditorSettings::instance()->initializeEditor(editor); } -Core::Command *GLSLEditorPlugin::addToolAction(QAction *a, Core::ActionManager *am, +Core::Command *GLSLEditorPlugin::addToolAction(QAction *a, Core::Context &context, const Core::Id &id, Core::ActionContainer *c1, const QString &keySequence) { - Core::Command *command = am->registerAction(a, id, context); + Core::Command *command = Core::ActionManager::registerAction(a, id, context); if (!keySequence.isEmpty()) command->setDefaultKeySequence(QKeySequence(keySequence)); c1->addAction(command); |