Verified that changing the keyboard layout through the tray icon invokes KeyboardDaemon::layoutChanged() where currentLayout is updated.
Then kquitapp kded5 and it saved the proper layout.
Didn't test whether other means (there's perhaps other ways the layout can change? dunno, it's X.) still work.