kcms/users: reset dialog state on close button press

Reason for the change

  • kcms/users: reset dialog state on close button press

kcm_users has some shared dialog state handling between the C++ backend and qml. Picking a finger is exclusively handled from the qml side, C++ does not interfere with this state (unless there is an error, in which case it will reset the state to list). The only way out of this state in qml is to actually pick a finger. The dialog (reasonably) has a close button, which calls reject() on the dialog (Kirigami default), but nothing actually binds to that so the dialog remains in the pick finger state at least as far as the button row is concerned, which means no Add button even though the displayed contents (handled independently) have returned to the default list state. There's some logic to reset the state, but only while enrolling - but we were still picking the finger, not enrolling yet.

Instead, reset the state when reject is emitted. When calling stopEnrolling, the backend will always reset the dialog state, but do further actions only if actually enrolling (which we're not here).

Test plan

See bug report

Screenshots or screen recordings

N/A

Bugs fixed

BUG: 514088 FIXED-IN: 6.5.5


@traceyc Could you give this one a try, as you were able to reproduce the bug? I managed to as well, but only by hacking a bunch of things in kcm_users as I don't actually have a fingerprint reader. Would be good to have a clean test as well.

Merge request reports

Loading
Loading