Bug 475097

Summary: Clipboard shortcut changes still applied after cancelling configuration
Product: [Plasma] plasmashell Reporter: Nicolas Fella <nicolas.fella>
Component: Clipboard widget & pop-upAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: nate
Priority: NOR    
Version First Reported In: 5.27.8   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 6.0
Sentry Crash Report:

Description Nicolas Fella 2023-10-01 13:52:44 UTC
STEPS TO REPRODUCE
1. In the clipboard applet, go "Configure Clipboard"
2. Go to "Shortcuts"
3. Change any shortcut setting
4. Click cancel
5. Open settings again

OBSERVED RESULT
The change was applied

EXPECTED RESULT
The change was discarded

SOFTWARE/OS VERSIONS
KDE Plasma Version: master
KDE Frameworks Version: master
Qt Version: 6.6
Comment 1 Nicolas Fella 2023-10-01 14:45:45 UTC
Also happens on 5.27
Comment 2 Nicolas Fella 2023-10-01 15:33:42 UTC Comment hidden (spam)
Comment 3 Bug Janitor Service 2023-10-21 00:22:12 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kxmlgui/-/merge_requests/200
Comment 4 Christoph Cullmann 2023-10-24 19:34:32 UTC
Git commit b7365dfc6e7418b4214d671b27c0f8a67bc07021 by Christoph Cullmann, on behalf of Nicolas Fella.
Committed on 24/10/2023 at 21:26.
Pushed by cullmann into branch 'master'.

[kshortcuteditor] Undo pending changes on destruction

Currently one has to manually call undo() to discard pending changes when being done with the widget.

This is error-prone because it's easy to forget or cause use-after-free issues when calling undo() on an already deleted editor.

Instead automatically undo() on destruction
Related: bug 475095, bug 475083

M  +5    -1    src/kshortcutseditor.cpp

https://invent.kde.org/frameworks/kxmlgui/-/commit/b7365dfc6e7418b4214d671b27c0f8a67bc07021