summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/batteryapplet/batterystatus.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/core/applets/batteryapplet/batterystatus.cpp b/core/applets/batteryapplet/batterystatus.cpp
index 08ddc85..9622726 100644
--- a/core/applets/batteryapplet/batterystatus.cpp
+++ b/core/applets/batteryapplet/batterystatus.cpp
@@ -61,53 +61,51 @@ bool BatteryStatus::getProcApmStatusIpaq() {
perc1 = (*line).mid(((*line).find('('))+1,(*line).find(')')-(*line).find('(')-2);
}
} else if( (*line).startsWith(" Life") ) {
if (bat2 == true) {
sec2 = (*line).mid(((*line).find(':')+2), 5 );
} else {
sec1 = (*line).mid(((*line).find(':')+2), 5 );
}
} else if( (*line).startsWith("Battery #1") ) {
bat2 = true;
} else if( (*line).startsWith(" Status") ) {
if (bat2 == true) {
jackStatus = (*line).mid((*line).find('(')+1, (*line).find(')')-(*line).find('(')-1);
} else {
ipaqStatus = (*line).mid((*line).find('(')+1, (*line).find(')')-(*line).find('(')-1);
}
} else if( (*line).startsWith(" Chemistry") ) {
if (bat2 == true) {
jackChem = (*line).mid((*line).find('('), (*line).find(')')-(*line).find('(')+1);
} else {
ipaqChem = (*line).mid((*line).find('('), (*line).find(')')-(*line).find('(')+1);
}
}
}
- } else {
- QMessageBox::warning(this, tr("Failure"),tr("could not open file"));
+ procApmIpaq.close();
}
- procApmIpaq.close();
jackPercent = perc2.toInt();
ipaqPercent = perc1.toInt();
if (perc2.isEmpty() || perc2 == "unknow" ) {
perc2 = tr("no data");
} else {
perc2 += " %";
}
if (sec2 == "0" || sec2 == "" || sec2.isEmpty()) {
sec2 = tr("no data");
} else {
sec2 += " min";
}
jackStatus.prepend( " ( " );
jackStatus.append( " )" );
return true;
}
void BatteryStatus::updatePercent( int pc ) {
percent = pc;
repaint(FALSE);