//Battery Availability bool LOS::hasBattery(){ static int hasbat = -1; if(hasbat < 0 ){ int val = batteryCharge(); if(val >= 0 && val <= 100){ hasbat = 1; } else{ hasbat = 0; } } return (hasbat==1); }
void AtPhoneIndicators::updateBatteryCharge() { int value = batteryCharge(); if ( value < 0 ) setValue( d->battchg, 0 ); else if ( value > 95 ) setValue( d->battchg, 5 ); else setValue( d->battchg, value * 5 / 100 ); emit batteryChargeChanged( value ); }