Commit fce8bc1e authored by Jason Nader's avatar Jason Nader 🇦🇽 Committed by Nicolas Fella

plugins/battery: add battery charge info to the update signal

(cherry picked from commit b5ac96ce)
parent ccde0558
......@@ -88,7 +88,7 @@ public:
~BatteryDbusInterface() override;
void refreshedProxy();
void refreshedProxy(bool isCharging, int charge);
class KDECONNECTINTERFACES_EXPORT DeviceNotificationsDbusInterface
......@@ -123,7 +123,7 @@ bool BatteryPlugin::receivePacket(const NetworkPacket& np)
m_charge = np.get<int>(QStringLiteral("currentCharge"), -1);
const int thresholdEvent = np.get<int>(QStringLiteral("thresholdEvent"), (int)ThresholdNone);
Q_EMIT refreshed();
Q_EMIT refreshed(m_isCharging, m_charge);
if (thresholdEvent == ThresholdBatteryLow && !m_isCharging) {
Daemon::instance()->sendSimpleNotification(QStringLiteral("batteryLow"), i18nc("device name: low battery", "%1: Low Battery", device()->name()), i18n("Battery at %1%", m_charge), QStringLiteral("battery-040"));
......@@ -31,7 +31,7 @@ public:
bool isCharging() const;
Q_SCRIPTABLE void refreshed();
Q_SCRIPTABLE void refreshed(bool isCharging, int charge);
void slotChargeChanged();
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