[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
Please register or sign in to comment