broulik accepted this revision.
broulik added a comment.
This revision is now accepted and ready to land.


  Lovely!

INLINE COMMENTS

> main.qml:97
>      Component.onCompleted: {
> -        currentBattery = kcm.batteries.get(0)
> -        currentVendor = kcm.batteries.vendor(0)
> -        currentProduct = kcm.batteries.product(0)
> -        currentUdi = kcm.batteries.udi(0)
> +        currentBattery = kcm.batteries.data(kcm.batteries.index(0, 0), 
> BatteryModel.BatteryRole)
> +        currentVendor = kcm.batteries.data(kcm.batteries.index(0, 0), 
> BatteryModel.VendorRole)

You could probably move that into a `function initCurrent()` or similar and 
call it in both this and the change handler

You can also probably cache the `index` in a variable to only query it once

REPOSITORY
  R102 KInfoCenter

BRANCH
  clean-up

REVISION DETAIL
  https://phabricator.kde.org/D23391

To: meven, broulik
Cc: plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, fbampaloukas, GB_2, 
ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, 
abetts, sebas, apol, mart

Reply via email to