From 0944bfb7f08ff3bc8ec7f0af922ec65f54fa866c Mon Sep 17 00:00:00 2001 From: David Schulz Date: Tue, 25 Oct 2022 15:01:34 +0200 Subject: [PATCH] Editor: Fix find usage position in context menu Do not add the find usage action to an editor context menu if it is already there. Change-Id: I0a98d81ae0e08be69ca2579af5701b5fbc8ccbda Reviewed-by: Christian Kandeler --- src/plugins/texteditor/texteditor.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index b13982f49fd..1c5e2dd855f 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -8022,8 +8022,11 @@ void TextEditorWidget::setupFallBackEditor(Id id) void TextEditorWidget::appendStandardContextMenuActions(QMenu *menu) { - if (optionalActions() & TextEditorActionHandler::FindUsage) - menu->addAction(ActionManager::command(Constants::FIND_USAGES)->action()); + if (optionalActions() & TextEditorActionHandler::FindUsage) { + const auto findUsage = ActionManager::command(Constants::FIND_USAGES)->action(); + if (!menu->actions().contains(findUsage)) + menu->addAction(findUsage); + } menu->addSeparator(); appendMenuActionsFromContext(menu, Constants::M_STANDARDCONTEXTMENU);