Commit afff6ae6 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

Close low battery notificaton when showing critical

When not acknowledging the low battery notification, close it when showing the critical one,
to avoid showing contradicting notifications.

Differential Revision: https://phabricator.kde.org/D29594
parent aa60c4f6
......@@ -607,6 +607,10 @@ void Core::handleLowBattery(int percent)
void Core::handleCriticalBattery(int percent)
{
if (m_lowBatteryNotification) {
m_lowBatteryNotification->close();
}
// no parent, but it won't leak, since it will be closed both in case of timeout or direct action
m_criticalBatteryNotification = new KNotification(QStringLiteral("criticalbattery"), KNotification::Persistent, nullptr);
m_criticalBatteryNotification->setComponentName(QStringLiteral("powerdevil"));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment