Skip to content
Verified Commit 9621b3c1 authored by ivan tkachenko's avatar ivan tkachenko 🗯
Browse files

[applets/batterymonitor] BatteryItem: Simplify access to simply named model roles

The code is not consistent on how do we access properties (role names)
of rows/models of Plasma Data Engine's Data Source. This is obviously
due to the fact that some properties (role names) contain literal
spaces, and thus -- as explained in previous commit -- are currently
inexpressible in terms of QML properties.

However, even at the cost of inconsistency, `battery.State` reads better
than `battery["State"]`; while `battery["Is Power Supply"]` reads the
way it is, just because there's literally no other way around it.

(Actually, we could create a ECMAScript class, and deserialize data
source's row into sanely named fields. But that's a good proposal for
another patch.)
parent 8912efdf
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