Skip to content

Avatar: fix code style, port actions to QObjects

ivan tkachenko requested to merge work/ratijas/avatar-codestyle into master

Fix up code style, optimize some code

Use modern C++ stuff for loops; reset QML Control paddings instead of rebinding manually in a less efficient JavaScript.

Port actions group property members to QObject* and manage lifecycle

It is important to emit change signals whenever a QObject member is destroyed. MEMBER syntax of Q_PROPERTY won't manage that for you.

Also, main and secondary actions were meant to be Kirigami.Actions, but since Kirigami.Action is a pure QML type and QQC2.Action is in a private header, QObject* is unfortunately as close as we can get to its real type. Which is still better than QVariant, and gives us some stronger nullability guarantees (e.g. can't be undefined or other meaningless type).


Note that as discussed in #50 (closed) actions might get removed soon. But even in that case, I'd prefer removing some working code.

Merge request reports

Loading