CVS commit by vkrause: ACPI battery handling: Don't return a remaining time value if - there is no battery present - we don't have a (dis-)charging rate This should help with bug #67427. CCMAIL: 67427@bugs.kde.org M +5 -3 portable.cpp 1.87 --- kdeutils/klaptopdaemon/portable.cpp #1.86:1.87 @@ -511,9 +511,11 @@ acpi_read(apm_info *ap) rate += saved_rate[i]; rate = (rate+2*saved_rate[0])/(nrates+2); // weight it slighly - ap->battery_time = ((rate==0||part==0)?0 : 60*part/rate); + ap->battery_time = (rate==0 ? -1 : 60*part/rate); } ap->battery_percentage = (total==0?0:100*part/total); - if (!present) + if (!present) { ap->battery_percentage = -1; + ap->battery_time = -1; + } ap->apm_flags = 0; return(ret);