forked from qt-creator/qt-creator
TextEditor: add find usage to context menu
... of the generic text editor if the editor has the FindUsage optional action mask set. This is mainly used to show this action when a language server is configured for this editor that supports find usages. Change-Id: I55c6983cd553c46817332144f78f1207185ac3f6 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -7935,10 +7935,13 @@ void TextEditorWidget::setupFallBackEditor(Id id)
|
|||||||
|
|
||||||
void TextEditorWidget::appendStandardContextMenuActions(QMenu *menu)
|
void TextEditorWidget::appendStandardContextMenuActions(QMenu *menu)
|
||||||
{
|
{
|
||||||
|
if (optionalActions() & TextEditorActionHandler::FindUsage)
|
||||||
|
menu->addAction(ActionManager::command(Constants::FIND_USAGES)->action());
|
||||||
|
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
appendMenuActionsFromContext(menu, Constants::M_STANDARDCONTEXTMENU);
|
appendMenuActionsFromContext(menu, Constants::M_STANDARDCONTEXTMENU);
|
||||||
Command *bomCmd = ActionManager::command(Constants::SWITCH_UTF8BOM);
|
|
||||||
if (bomCmd) {
|
if (Command *bomCmd = ActionManager::command(Constants::SWITCH_UTF8BOM)) {
|
||||||
QAction *a = bomCmd->action();
|
QAction *a = bomCmd->action();
|
||||||
TextDocument *doc = textDocument();
|
TextDocument *doc = textDocument();
|
||||||
if (doc->codec()->name() == QByteArray("UTF-8") && doc->supportsUtf8Bom()) {
|
if (doc->codec()->name() == QByteArray("UTF-8") && doc->supportsUtf8Bom()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user