Bug 426808

Summary: Right-clicking on the same link multiple times duplicates link-related entries in context menu
Product: [Applications] konsole Reporter: Yash Tiwari <yasht>
Component: copy-pasteAssignee: Yash Tiwari <yasht>
Status: RESOLVED FIXED    
Severity: normal CC: nate, tumaix
Priority: VHI Keywords: regression
Version: 20.08.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 20.08.3
Sentry Crash Report:
Attachments: The bug
Many Duplicates

Description Yash Tiwari 2020-09-21 11:17:06 UTC
Created attachment 131830 [details]
The bug

SUMMARY
Duplicate entries for links i.e 'Open Link' & 'Copy Link Address' appear in the right-click context menu. I have tested it on Konsole, Dolphin and Kate and the behavior can be experienced in all of them. It only triggers when the link is highlighted. 

STEPS TO REPRODUCE
1. Right click on a link
2. Remove the right click context-menu by click outside it
3. Highlight the link or the row of the link by double clicking
4. Right click on the link

OBSERVED RESULT
Duplicate entries for 'Open Link' & 'Copy Link Address'

EXPECTED RESULT
One Entry for 'Open Link' & 'Copy Link Address'

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: openSUSE Tumbleweed
KDE Plasma Version: 5.19.5
KDE Frameworks Version: 5.73.0
Qt Version: 5.15.1
Comment 1 Nate Graham 2020-09-23 18:40:37 UTC
That's odd. I cannot reproduce.
Comment 2 Yash Tiwari 2020-09-24 05:30:02 UTC
Created attachment 131902 [details]
Many Duplicates
Comment 3 Yash Tiwari 2020-09-24 05:31:14 UTC
I was able to achieve this by first highlighting the link and then just right-clicking multiple times on the highlighted link
Comment 4 Yash Tiwari 2020-09-24 05:31:59 UTC
It also works on master
Comment 5 Nate Graham 2020-09-24 13:52:25 UTC
LOL that was it. Now I can reproduce the issue too. Looks like we're not checking for the existence of the menu items before we create more. Tomaz, Can you investigate?
Comment 6 Kurt Hindenburg 2020-10-24 01:12:41 UTC
Git commit 44f00a490a9bed1741fee23c6aedeff6ec4c24ef by Kurt Hindenburg, on behalf of Carlos Alves.
Committed on 24/10/2020 at 01:11.
Pushed by hindenburg into branch 'master'.

Fix duplicates link-related entries in context menu
FIXED-IN: 20.08.3

!237

M  +12   -1    src/session/SessionController.cpp

https://invent.kde.org/utilities/konsole/commit/44f00a490a9bed1741fee23c6aedeff6ec4c24ef
Comment 7 Kurt Hindenburg 2020-10-24 01:24:05 UTC
Git commit 532b7b965956f5ad04e90b07fbcc4fcc00885bdb by Kurt Hindenburg, on behalf of Yash Tiwari.
Committed on 24/10/2020 at 01:23.
Pushed by hindenburg into branch 'release/20.08'.

Fix duplicates link-related entries in context menu
FIXED-IN: 20.08.3

!237

M  +12   -1    src/SessionController.cpp

https://invent.kde.org/utilities/konsole/commit/532b7b965956f5ad04e90b07fbcc4fcc00885bdb
Comment 8 Kurt Hindenburg 2020-10-31 18:27:07 UTC
The 'Copy location" still duplicates on 20.08.3; the master patch can't be used due to other changes.  I'll see if I can get something working before the deadline Nov 2nd.