diff --git a/components/mobileshell/qml/dataproviders/BatteryInfo.qml b/components/mobileshell/qml/dataproviders/BatteryInfo.qml index 96b4f573..97c01c83 100644 --- a/components/mobileshell/qml/dataproviders/BatteryInfo.qml +++ b/components/mobileshell/qml/dataproviders/BatteryInfo.qml @@ -1,4 +1,5 @@ /* + * SPDX-FileCopyrightText: 2024 Sebastian Kügler * SPDX-FileCopyrightText: 2021 Devin Lin * SPDX-FileCopyrightText: 2019 Marco Martin * @@ -8,18 +9,17 @@ pragma Singleton import QtQuick -import QtQuick.Layouts -import org.kde.plasma.plasma5support as P5Support -import org.kde.plasma.workspace.components as PW +import org.kde.plasma.private.battery -QtObject { - property bool isVisible: pmSource.data["Battery"]["Has Cumulative"] - property int percent: pmSource.data["Battery"]["Percent"] - property bool pluggedIn: pmSource.data["AC Adapter"] ? pmSource.data["AC Adapter"]["Plugged in"] : false +Item { - property P5Support.DataSource pmSource: P5Support.DataSource { - engine: "powermanagement" - connectedSources: ["Battery", "AC Adapter"] + BatteryControlModel { + id: batteryControl } + + property bool isVisible: batteryControl.hasInternalBatteries + property int percent: batteryControl.percent + property bool pluggedIn: batteryControl.pluggedIn + property alias batteries: batteryControl }