Skip to content

Code refactoring around GAction-GSettings binding

This MR is a kind of complement to !30 (merged), where I hadn't really seen the full benefit of the correspondence that can be established between GAction and GSettings (both use GVariant and names can match).

The first preliminary commit is essentially a renaming, to use setting names compatible with actions names (for which / is a forbidden character).

The main job is done in the second commit, where most of the setting-related actions (mainly toggles) are transferred from the window level to the application level, resulting in only three generic handlers:

  • toggle_activate()
  • radio_activate()
  • action_update()

The two first handlers update the settings on action activation, while the third one updates in turn the action state on settings change. The way the actions are added to the application and initialized is quite concise too, again thanks to the correspondence between GAction and GSettings.

As mousepad/resources/ui/mousepad-prefs-dialog.ui was already heavily impacted by these changes, I took the opportunity to do some cleaning (consistency and/or updating of the notations used), and incorporate some object property bindings currently made in mousepad/mousepad-prefs-dialog.c.

All these changes are purely code refactoring, that are not supposed to change anything in Mousepad behavior. That's why I kept a little additional change in a third separate commit: a reformulation of the "Home/End Keys" setting description, which I find rather incomprehensible as it is currently.

Merge request reports