From 44f00a490a9bed1741fee23c6aedeff6ec4c24ef Mon Sep 17 00:00:00 2001 From: Carlos Alves Date: Fri, 23 Oct 2020 21:10:06 -0400 Subject: [PATCH] Fix duplicates link-related entries in context menu BUG: 426808 FIXED-IN: 20.08.3 !237 --- src/session/SessionController.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/session/SessionController.cpp b/src/session/SessionController.cpp index 6b08ed107..4deab65d7 100644 --- a/src/session/SessionController.cpp +++ b/src/session/SessionController.cpp @@ -1790,7 +1790,18 @@ void SessionController::showDisplayContextMenu(const QPoint& position) #else copy->setShortcut(Konsole::ACCEL + Qt::SHIFT + Qt::Key_C); #endif - // prepend content-specific actions such as "Open Link", "Copy Email Address" etc. + + // remove content-specific actions such as "Open Link", "Copy Email Address" etc + + if (popup->actions()[0]->objectName() == QStringLiteral("open-action") && + popup->actions()[1]->objectName() == QStringLiteral("copy-action")) + { + popup->removeAction(popup->actions().value(0, nullptr)); + popup->removeAction(popup->actions().value(0, nullptr)); + } + + // prepend content-specific actions such as "Open Link", "Copy Email Address" etc + QSharedPointer hotSpot = _sessionDisplayConnection->view()->filterActions(position); if (hotSpot != nullptr) { popup->insertActions(popup->actions().value(0, nullptr), hotSpot->actions() << contentSeparator );