use MSD for battery calculations, fix segfault

This commit is contained in:
2017-08-25 06:11:18 +03:00
parent ea5d73d8fd
commit 2d7d4c55a2
5 changed files with 68 additions and 41 deletions

View File

@ -106,7 +106,9 @@ QStringList AWDataEngineMapper::registerSource(const QString &_source,
QString key = _source;
key.remove("battery/");
m_map[_source] = key;
m_formatter[key] = AWKeysAggregator::FormatterType::IntegerThree;
m_formatter[key] = _source.contains("rate")
? AWKeysAggregator::FormatterType::Float
: AWKeysAggregator::FormatterType::IntegerThree;
} else if (_source == "cpu/system/TotalLoad") {
// cpu
m_map[_source] = "cpu";