Browse Source

Fix units of battery values in Device Manager.

Previously it was not clear whether the units in tdehwlib are
in Wh and W or Ah and A. Now the units are always Ah and A.

This is related to issue TDE/tdelibs#68.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/130/head
Slávek Banko 1 month ago
parent
commit
0215a0e712
Signed by: SlavekB <slavek.banko@axis.cz> GPG Key ID: 608F5293A04BE668
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      kcontrol/hwmanager/devicepropsdlg.cpp

+ 4
- 4
kcontrol/hwmanager/devicepropsdlg.cpp View File

@@ -554,12 +554,12 @@ void DevicePropertiesDialog::populateDeviceInformation() {
if (m_device->type() == TDEGenericDeviceType::Battery) {
TDEBatteryDevice* bdevice = static_cast<TDEBatteryDevice*>(m_device);

base->labelCurrentBatteryEnergy->setText((bdevice->energy()<0)?i18n("<unknown>"):TQString("%1 Wh").arg(bdevice->energy()));
base->labelMaximumBatteryEnergy->setText((bdevice->maximumEnergy()<0)?i18n("<unknown>"):TQString("%1 Wh").arg(bdevice->maximumEnergy()));
base->labelMaximumBatteryDesignEnergy->setText((bdevice->maximumDesignEnergy()<0)?i18n("<unknown>"):TQString("%1 Wh").arg(bdevice->maximumDesignEnergy()));
base->labelCurrentBatteryEnergy->setText((bdevice->energy()<0)?i18n("<unknown>"):TQString("%1 Ah").arg(bdevice->energy()));
base->labelMaximumBatteryEnergy->setText((bdevice->maximumEnergy()<0)?i18n("<unknown>"):TQString("%1 Ah").arg(bdevice->maximumEnergy()));
base->labelMaximumBatteryDesignEnergy->setText((bdevice->maximumDesignEnergy()<0)?i18n("<unknown>"):TQString("%1 Ah").arg(bdevice->maximumDesignEnergy()));
base->labelMinimumBatteryVoltage->setText((bdevice->minimumVoltage()<0)?i18n("<unknown>"):TQString("%1 V").arg(bdevice->minimumVoltage()));
base->labelCurrentBatteryVoltage->setText((bdevice->voltage()<0)?i18n("<unknown>"):TQString("%1 V").arg(bdevice->voltage()));
base->labelCurrentBatteryDischargeRate->setText((bdevice->dischargeRate()<0)?i18n("<unknown>"):TQString("%1 Wh").arg(bdevice->dischargeRate()));
base->labelCurrentBatteryDischargeRate->setText((bdevice->dischargeRate()<0)?i18n("<unknown>"):TQString("%1 A").arg(bdevice->dischargeRate()));
TQString batteryStatusString = i18n("Unknown");
TDEBatteryStatus::TDEBatteryStatus batteryStatus = bdevice->status();
if (batteryStatus == TDEBatteryStatus::Charging) {


Loading…
Cancel
Save