Don't alert on "100% idle", increase readability
This commit is contained in:
parent
f698a4c336
commit
28d4e4277d
2 changed files with 4 additions and 4 deletions
|
@ -166,12 +166,12 @@ void Battery::showNotification() {
|
||||||
|
|
||||||
qInfo() << "battery" << charge << "low" << settings->getLowAlert() << "high" << settings->getHighAlert() << "state" << state;
|
qInfo() << "battery" << charge << "low" << settings->getLowAlert() << "high" << settings->getHighAlert() << "state" << state;
|
||||||
|
|
||||||
if(charge <= settings->getLowAlert() && state.compare("charging")) {
|
if(charge <= settings->getLowAlert() && state != "charging") {
|
||||||
qDebug() << "Battery notification timer: empty enough battery";
|
qDebug() << "Battery notification timer: empty enough battery";
|
||||||
notification->send(settings->getNotificationTitle().arg(charge), settings->getNotificationLowText(), settings->getLowAlertFile());
|
notification->send(settings->getNotificationTitle().arg(charge), settings->getNotificationLowText(), settings->getLowAlertFile());
|
||||||
}
|
}
|
||||||
else if((charge >= settings->getHighAlert() && state.compare("discharging"))
|
else if((charge >= settings->getHighAlert() && state != "discharging")
|
||||||
|| (charge == 100 && !state.compare("idle"))) {
|
&& !(charge == 100 && state == "idle")) {
|
||||||
qDebug() << "Battery notification timer: full enough battery";
|
qDebug() << "Battery notification timer: full enough battery";
|
||||||
notification->send(settings->getNotificationTitle().arg(charge), settings->getNotificationHighText(), settings->getHighAlertFile());
|
notification->send(settings->getNotificationTitle().arg(charge), settings->getNotificationHighText(), settings->getHighAlertFile());
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ void Notification::send(QString title, QString body, QString soundFile)
|
||||||
|
|
||||||
void Notification::close()
|
void Notification::close()
|
||||||
{
|
{
|
||||||
if(noteID.compare("1") == 0)
|
if(noteID == "1")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QStringList args;
|
QStringList args;
|
||||||
|
|
Loading…
Reference in a new issue