Bug 438893

Summary: Enabling/disabling Kate plugins occurs immediately, OK/Apply/Cancel have no effect
Product: [Applications] kate Reporter: nyanpasu64 <nyanpasu64>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: christoph
Priority: NOR    
Version First Reported In: 21.04.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 23.04.0
Sentry Crash Report:

Description nyanpasu64 2021-06-19 00:42:27 UTC
SUMMARY
In Kate's Configure -> Plugins panel, if I check or uncheck plugins, they take effect immediately, OK/Apply have no effect, and Cancel doesn't undo changes.

STEPS TO REPRODUCE
1. Open Kate.
2. Open "Configure Kate" and go to the Plugins panel.
3. Check (or uncheck) a plugin.

OBSERVED RESULT
The plugin loads/unloads immediately, but the Apply button activates too. Pressing OK confirms the plugin as expected, pressing Apply does nothing, and pressing Cancel acts like pressing OK (the plugin state remains changed after the dialog closes, or even if you restart Kate). Closing the window with the title bar X button pops up a "save/discard/cancel" dialog, but Save and Discard do the same thing, since the contents were already saved.

(Note that whether you press OK or Cancel, the settings get cleared rather than saved, if you send SIGINT/SIGTERM/SIGKILL to the Kate process. Only closing the window normally persists the settings for future Kate windows.)

EXPECTED RESULT
Either plugin loading/unloading should be delayed until you press OK or Apply, or OK/Apply should not be enabled (nor should the save/discard/cancel dialog) when you check or uncheck plugins (which enables them right away). In the latter case, ideally the UI would be changed to make this clear as well, but I'm not sure how.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.22.1
KDE Frameworks Version: 5.83.0
Qt Version: 5.15.2
Kernel Version: 5.12.10-zen1-1-zen (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 5600X 6-Core Processor
Memory: 15.6 GiB of RAM
Graphics Processor: NVIDIA GeForce GT 730/PCIe/SSE2

ADDITIONAL INFORMATION
Comment 1 Bug Janitor Service 2022-11-12 19:59:06 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1008
Comment 2 Christoph Cullmann 2022-11-13 10:20:10 UTC
Git commit f93387f1f768338411859fcf6307cf16e3c52453 by Christoph Cullmann.
Committed on 13/11/2022 at 10:12.
Pushed by cullmann into branch 'master'.

delay plugin load/unload until we save

M  +8    -3    apps/lib/kateconfigdialog.cpp
M  +2    -0    apps/lib/kateconfigdialog.h
M  +22   -7    apps/lib/kateconfigplugindialogpage.cpp
M  +6    -0    apps/lib/kateconfigplugindialogpage.h

https://invent.kde.org/utilities/kate/commit/f93387f1f768338411859fcf6307cf16e3c52453