While KXmlGui makes sure to prevent the user from hiding toolbars when not allowed,
when right-clicking an empty space in a QMainWindow, such as the menu bar, will yield
a menu created by Qt, which knows nothing about Kiosk restrictions, listing all toolbar
toggle actions of this window.
Details
I can no longer hide the main toolbar in Dolphin or Gwenview.
See comment in the code for an explanation what it actually does :)
In principle we could also think of enforcing other KAuthorized stuff here but both KXmlGui and KActionCollection take care of most of it.
How can I simulate the KAuthorized stuff for an autotest? Is there a KConfig kdeglobals test mode or something like that?
Diff Detail
- Repository
- R135 Integration for Qt applications in Plasma
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Seems messy when we we can just do:
toggleViewAction()->setEnabled(KAuthorized...)
in the KToolBar constructor
It'd fix all the cases which we're trying to fix as KIOSK only affects KDE apps.
How can I simulate the KAuthorized stuff for an autotest? Is there a KConfig kdeglobals test mode or something like that?
You don't need it in kdeglobals.
See what I did in https://git.reviewboard.kde.org/r/127948/
Note that if you have it immutable in /etc/kde5rc that will block the writeEntry. I lost half an hour trying to figure that one out.
Was a fancy little thing but patching KToolBar is significantly less invasive and will work for most of our apps.