Thanks to @broulik for finding this bug, and (in advance) for testing this fix on his system. What happened was that I tested the original patch while on battery, which apparently added just enough time for the models to initialize. While plugged in though, the KCM starts with the "On AC Power" tab and that one initialized its comboboxes incorrectly.
Commit 8ecf6430(MR !337) caused empty combobox selections on initial load.My theory is that binding against indexOfValue(...)
does notestablish a binding to changes in the model itself.
Work around that by testing against the count
property withinthe currentIndex
binding. This implicitly adds a binding againstmodel changes - or at least row count changes in the model, which isgood enough as our models won't change after having added allsupported options.
As a bonus change, we also convert powerProfileCombo
's currentIndex
to the same declarative style instead of using imperative assignment.