D18961: [WIP] [weather] Migrate nativeInterface config to plasmoid.configuration.*
Chris Holland
noreply at phabricator.kde.org
Tue Feb 12 14:57:49 GMT 2019
Zren created this revision.
Herald added a project: Plasma.
Herald added a subscriber: plasma-devel.
Zren requested review of this revision.
REVISION SUMMARY
If `plasmoid.nativeInterface.source != ""`, we copy it to `plasmoid.configuration.source` + same
with all other properties besides `needsToBeSquare` which is a "session" variable that updated
right after the migration code.
The selected weather `services` StringList is not a `nativeInterface` property, so it needs to be copied differently.
-----
We could also copy the other properties the using the `configValues().services` pattern if you want the code consistent.
This is a pure QML solution. Ideally, the final patch will have a few more C++ functions/enums exposed to the QML. The `DisplayUnits.qml` properties could be turned into functions. Eg:
Utils.parseTemperatureUnitId(plasmoid.configuration.temperatureUnitId)
That way we don't have magic numbers (`6001 // Celcius`) littered throughout `DisplayUnits.qml`.
-----
Ideally, we'll only keep the `nativeInterface` + migration code until Plasma 5.19 assuming Plasma 5.18 is the next Plasma LTS version. We could remove the migration code earlier, as having the user re-setup their weather widget isn't terribly cumbersome for the user.
Once it no longer depends on the `nativeInterface`, users can easily fork the default weather widget.
Immendiate benefits are that we no longer have to install the widget to `.../share/plasma/plasmoids/` to test the widget's QML. We can now use `plasmoidviewer -a package`. Note that we still need to install to `~/.local/share/plasma/plasmoids/` to test the `nativeInterface` migration code as mentioned in the test plan.
TEST PLAN
- Apply patch.
- Copy `weather/package` to `~/.local/share/plasma/plasmoids/` and rename the `package` directory to `org.kde.plasma.weather`.
- Restart plasmashell with `kstart5 -- plasmashell --replace`
- The settings should have migrated, and the widget should still work.
REPOSITORY
R114 Plasma Addons
REVISION DETAIL
https://phabricator.kde.org/D18961
AFFECTED FILES
applets/weather/package/contents/config/main.xml
applets/weather/package/contents/ui/CompactRepresentation.qml
applets/weather/package/contents/ui/DisplayUnits.qml
applets/weather/package/contents/ui/config/ConfigAppearance.qml
applets/weather/package/contents/ui/config/ConfigUnits.qml
applets/weather/package/contents/ui/config/ConfigWeatherStation.qml
applets/weather/package/contents/ui/config/WeatherStationPicker.qml
applets/weather/package/contents/ui/main.qml
To: Zren
Cc: plasma-devel, jraleigh, GB_2, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20190212/026b7e95/attachment.html>
More information about the Plasma-devel
mailing list