D28127: Add some new battery sensors : energy_now, energy_full and power_now.

Anthony Fieroni noreply at phabricator.kde.org
Wed Apr 8 11:58:24 BST 2020


anthonyfieroni added inline comments.

INLINE COMMENTS

> acpi.c:147
>      if ( maximum > 0) {
> -        state = charge * 100 / maximum;
> +        state = charge/(float)(maximum/100);/* to get 0.1% changes */
>      }

`(float)(var_int/var_int)` does not what you want, it should be `((float)var_int / var_int)`

> acpi.c:179
>      if (maximum > 0) {
> -        state = charge * 100 / maximum;
> +        state = charge/(float)(maximum/100);/* to get 0.1% changes */
>      }

ditto

> acpi.c:211
> +    if ( maximum > 0) {
> +        state = charge/(float)(maximum/100);/* to get 0.1% changes */
> +    }

ditto

> acpi.c:243
> +    if (maximum > 0) {
> +        state = charge/(float)(maximum/100);/* to get 0.1% changes */
> +    }

ditto

REPOSITORY
  R106 KSysguard

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

To: jjorge, #plasma, davidedmundson, ahiemstra
Cc: anthonyfieroni, plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20200408/4144e48a/attachment.html>


More information about the Plasma-devel mailing list