ahiemstra added a comment.

  Good stuff. Just two small comments.
  
  Additionally, you may be interested in https://phabricator.kde.org/D28333 , 
which will eventually replace ksysguardd and has a better API for sensors.

INLINE COMMENTS

> acpi.c:82
> +    char name[ ACPIFILENAMELENGTHMAX ];
> +    readTypeFile("/sys/class/power_supply/BAT%d/type", number, name, 
> sizeof(name));
> +

These two lines are now repeated in all "registerX" functions. Maybe move this 
to initAcpiBattery and pass it to each function as a parameter?

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

You cast to double but then store it in a float, which implies a cast to float. 
Probably better to just cast to float directly. (Also applies to the functions 
below.)

REPOSITORY
  R106 KSysguard

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

To: jjorge, #plasma, davidedmundson, ahiemstra
Cc: 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

Reply via email to