Skip to content

Introduce PowerDevil::Enums, replacing two synchronized enum types

SuspendSession as well as ProfileGenerator both had an enum called Mode (or Modes) with the same enum names and values.

This commit takes PowerDevilEnums from Tomaz Canabrava's unmerged MR !71 (closed), with slight tweaks for better naming, and replaces both of the original enum declarations and uses with the new PowerDevil::Enums::PowerButtonAction.

In addition to a central place for shared enum declarations, this class also allows for later QML integration via Q_ENUM() macro.


@tcanabrava, @nicolasfella, @ngraham, @crossi, @ahiemstra, @alex, @bshah: I'm picking up Tomaz's MR !71 (closed), rebasing and carving out smaller MRs from it to make reviews a little easier. This is the first of the series. The next one will look at introducing the .kcfg[c] files, the migration function and some test infrastructure to increase the chance of a proper migration. (edit: Actually, I think perhaps the default value class can be done separately first.) The actual functional changes would follow afterwards, I haven't made it that far yet.

Thanks in advance for the review, and to @tcanabrava for having put so much effort into these changes already!

Edited by Jakob Petsovits

Merge request reports