mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-08-27 18:59:59 +00:00
improve update events
This commit is contained in:
@ -333,14 +333,14 @@ QVariantMap ExtendedSysMon::getBattery(const QString acpiPath)
|
||||
(fullLevelFile.open(QIODevice::ReadOnly))) {
|
||||
float batCurrent = QString(currentLevelFile.readLine()).trimmed().toFloat();
|
||||
float batFull = QString(fullLevelFile.readLine()).trimmed().toFloat();
|
||||
battery[QString("bat%1").arg(i)] = 100 * batCurrent / batFull;
|
||||
battery[QString("bat%1").arg(i)] = static_cast<int>(100 * batCurrent / batFull);
|
||||
currentLevel += batCurrent;
|
||||
fullLevel += batFull;
|
||||
}
|
||||
currentLevelFile.close();
|
||||
fullLevelFile.close();
|
||||
}
|
||||
battery[QString("bat")] = 100 * currentLevel / fullLevel;
|
||||
battery[QString("bat")] = static_cast<int>(100 * currentLevel / fullLevel);
|
||||
|
||||
return battery;
|
||||
}
|
||||
|
Reference in New Issue
Block a user