fix(build): fix build error

Description: 修复编译错误

Log: 无
This commit is contained in:
winnerym 2022-12-08 14:38:40 +08:00
parent 9ac5005d1a
commit 98eb6f43d0
1 changed files with 0 additions and 23 deletions

View File

@ -1909,29 +1909,6 @@ QString LockWidget::getBatteryIconName()
return QString();
}
QString LockWidget::getBatteryIconName()
{
if (iface->isValid() && dface->isValid()) {
bool batteryState = false;
QDBusReply<QVariant> reply = batInterface->call("Get", UPOWER_SERVICE, "OnBattery");
if (reply.isValid()) {
batteryState = reply.value().toBool();
}
double percentage = -1.0;
QDBusReply<QVariant> percentage_reply = iface->call("Get", UPOWER_DIVICES_SERVICE, "Percentage");
if (percentage_reply.isValid()) {
percentage = percentage_reply.value().toDouble();
}
if (true == batteryState) {
return QString("battery-level-%1-symbolic").arg((int)percentage / 10 * 10);
} else {
return QString("battery-level-%1-charging-symbolic").arg((int)percentage / 10 * 10);
}
}
return QString();
}
int LockWidget::getLoginedNum()
{
if(loginedNum != 0)