CppEditor: Move "Show Preprocessed Source" action further down

... in the menus.

Fixes: QTCREATORBUG-28537
Change-Id: I51b4a258da8d654521d0e32256a7143960898227
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2022-12-05 15:03:03 +01:00
parent 9deef74d9e
commit 36ebb4bf22

View File

@@ -12,7 +12,6 @@
#include "cppeditordocument.h" #include "cppeditordocument.h"
#include "cppeditorwidget.h" #include "cppeditorwidget.h"
#include "cppfilesettingspage.h" #include "cppfilesettingspage.h"
#include "cpphighlighter.h"
#include "cppincludehierarchy.h" #include "cppincludehierarchy.h"
#include "cppmodelmanager.h" #include "cppmodelmanager.h"
#include "cppoutline.h" #include "cppoutline.h"
@@ -261,21 +260,6 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
connect(openInNextSplitAction, &QAction::triggered, connect(openInNextSplitAction, &QAction::triggered,
this, [] { CppModelManager::switchHeaderSource(true); }); this, [] { CppModelManager::switchHeaderSource(true); });
QAction * const showPreprocessedAction = new QAction(tr("Show Preprocessed Source"), this);
command = ActionManager::registerAction(showPreprocessedAction,
Constants::SHOW_PREPROCESSED_FILE, context);
mcpptools->addAction(command);
connect(showPreprocessedAction, &QAction::triggered,
this, [] { CppModelManager::showPreprocessedFile(false); });
QAction * const showPreprocessedInSplitAction = new QAction
(tr("Show Preprocessed Source in Next Split"), this);
command = ActionManager::registerAction(showPreprocessedInSplitAction,
Constants::SHOW_PREPROCESSED_FILE_SPLIT, context);
mcpptools->addAction(command);
connect(showPreprocessedInSplitAction, &QAction::triggered,
this, [] { CppModelManager::showPreprocessedFile(true); });
MacroExpander *expander = globalMacroExpander(); MacroExpander *expander = globalMacroExpander();
expander->registerVariable("Cpp:LicenseTemplate", expander->registerVariable("Cpp:LicenseTemplate",
tr("The license template."), tr("The license template."),
@@ -316,9 +300,6 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST);
touchBar->addAction(cmd, Core::Constants::G_TOUCHBAR_NAVIGATION); touchBar->addAction(cmd, Core::Constants::G_TOUCHBAR_NAVIGATION);
cmd = ActionManager::command(Constants::SHOW_PREPROCESSED_FILE);
contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST);
cmd = ActionManager::command(TextEditor::Constants::FOLLOW_SYMBOL_UNDER_CURSOR); cmd = ActionManager::command(TextEditor::Constants::FOLLOW_SYMBOL_UNDER_CURSOR);
cmd->setTouchBarText(tr("Follow", "text on macOS touch bar")); cmd->setTouchBarText(tr("Follow", "text on macOS touch bar"));
contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST);
@@ -398,6 +379,22 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST);
cppToolsMenu->addAction(cmd); cppToolsMenu->addAction(cmd);
QAction * const showPreprocessedAction = new QAction(tr("Show Preprocessed Source"), this);
command = ActionManager::registerAction(showPreprocessedAction,
Constants::SHOW_PREPROCESSED_FILE, context);
mcpptools->addAction(command);
contextMenu->addAction(command, Constants::G_CONTEXT_FIRST);
connect(showPreprocessedAction, &QAction::triggered,
this, [] { CppModelManager::showPreprocessedFile(false); });
QAction * const showPreprocessedInSplitAction = new QAction
(tr("Show Preprocessed Source in Next Split"), this);
command = ActionManager::registerAction(showPreprocessedInSplitAction,
Constants::SHOW_PREPROCESSED_FILE_SPLIT, context);
mcpptools->addAction(command);
connect(showPreprocessedInSplitAction, &QAction::triggered,
this, [] { CppModelManager::showPreprocessedFile(true); });
d->m_openTypeHierarchyAction = new QAction(tr("Open Type Hierarchy"), this); d->m_openTypeHierarchyAction = new QAction(tr("Open Type Hierarchy"), this);
cmd = ActionManager::registerAction(d->m_openTypeHierarchyAction, Constants::OPEN_TYPE_HIERARCHY, context); cmd = ActionManager::registerAction(d->m_openTypeHierarchyAction, Constants::OPEN_TYPE_HIERARCHY, context);
cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+Shift+T") : tr("Ctrl+Shift+T"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+Shift+T") : tr("Ctrl+Shift+T")));