Skip to content

kcmodule: Revert to binding currentIndex in Component.onCompleted

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 (merged)) caused empty ComboBox selections on initial load. Turns out indexOfValue() can only be used after the Component.completed() signal is emitted, so a purely declarative binding worked incorrectly if queried too early by QML.

Therefore, we revert back to assigning a Qt.binding() to currentIndex in Component.onCompleted.

This commit also adapts PowerProfileModel and its associated ComboBox in a similar way as the other two models used in this KCM.

BUG: 483750 CCBUG: 482668

Edited by Jakob Petsovits

Merge request reports

Loading