Merge remote-tracking branch 'origin/9.0'

Conflicts:
	src/plugins/cppeditor/cppeditorplugin.cpp
	src/plugins/docker/dockerdevice.cpp

Change-Id: I41747ff9490e4ab20340d4d4acb4655100aaa3d2
This commit is contained in:
Eike Ziller
2022-12-07 10:47:47 +01:00
36 changed files with 353 additions and 284 deletions

View File

@@ -12,7 +12,6 @@
#include "cppeditordocument.h"
#include "cppeditorwidget.h"
#include "cppfilesettingspage.h"
#include "cpphighlighter.h"
#include "cppincludehierarchy.h"
#include "cppmodelmanager.h"
#include "cppoutline.h"
@@ -260,42 +259,6 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
connect(openInNextSplitAction, &QAction::triggered,
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); });
QAction * const findUnusedFunctionsAction = new QAction(tr("Find Unused Functions"), this);
command = ActionManager::registerAction(findUnusedFunctionsAction,
"CppTools.FindUnusedFunctions");
mcpptools->addAction(command);
connect(findUnusedFunctionsAction, &QAction::triggered,
this, [] { CppModelManager::findUnusedFunctions({}); });
QAction * const findUnusedFunctionsInSubProjectAction
= new QAction(tr("Find Unused C/C++ Functions"), this);
command = ActionManager::registerAction(findUnusedFunctionsInSubProjectAction,
"CppTools.FindUnusedFunctionsInSubProject");
for (ActionContainer * const projectContextMenu : {
ActionManager::actionContainer(ProjectExplorer::Constants::M_SUBPROJECTCONTEXT),
ActionManager::actionContainer(ProjectExplorer::Constants::M_PROJECTCONTEXT)}) {
projectContextMenu->addSeparator(ProjectExplorer::Constants::G_PROJECT_TREE);
projectContextMenu->addAction(command, ProjectExplorer::Constants::G_PROJECT_TREE);
}
connect(findUnusedFunctionsInSubProjectAction, &QAction::triggered, this, [] {
if (const Node * const node = ProjectTree::currentNode(); node && node->asFolderNode())
CppModelManager::findUnusedFunctions(node->directory());
});
MacroExpander *expander = globalMacroExpander();
expander->registerVariable("Cpp:LicenseTemplate",
tr("The license template."),
@@ -336,9 +299,6 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST);
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->setTouchBarText(tr("Follow", "text on macOS touch bar"));
contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST);
@@ -418,6 +378,44 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST);
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); });
QAction *const findUnusedFunctionsAction = new QAction(tr("Find Unused Functions"), this);
command = ActionManager::registerAction(findUnusedFunctionsAction,
"CppTools.FindUnusedFunctions");
mcpptools->addAction(command);
connect(findUnusedFunctionsAction, &QAction::triggered, this, [] {
CppModelManager::findUnusedFunctions({});
});
QAction *const findUnusedFunctionsInSubProjectAction
= new QAction(tr("Find Unused C/C++ Functions"), this);
command = ActionManager::registerAction(findUnusedFunctionsInSubProjectAction,
"CppTools.FindUnusedFunctionsInSubProject");
for (ActionContainer *const projectContextMenu :
{ActionManager::actionContainer(ProjectExplorer::Constants::M_SUBPROJECTCONTEXT),
ActionManager::actionContainer(ProjectExplorer::Constants::M_PROJECTCONTEXT)}) {
projectContextMenu->addSeparator(ProjectExplorer::Constants::G_PROJECT_TREE);
projectContextMenu->addAction(command, ProjectExplorer::Constants::G_PROJECT_TREE);
}
connect(findUnusedFunctionsInSubProjectAction, &QAction::triggered, this, [] {
if (const Node *const node = ProjectTree::currentNode(); node && node->asFolderNode())
CppModelManager::findUnusedFunctions(node->directory());
});
d->m_openTypeHierarchyAction = new QAction(tr("Open Type Hierarchy"), this);
cmd = ActionManager::registerAction(d->m_openTypeHierarchyAction, Constants::OPEN_TYPE_HIERARCHY, context);
cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+Shift+T") : tr("Ctrl+Shift+T")));