Revert "WeatherClient: Set enabled providers after setting a valid location"

libgweather changed to not do any implicit network traffic in property setters,
so this is again safe to pass to the constructor.

This reverts commit 73b7d9ace4.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3577

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1565>
This commit is contained in:
Florian Müllner 2021-01-12 18:33:43 +01:00 committed by Marge Bot
parent 52d271f5c1
commit 42ce04b108

View File

@ -68,11 +68,10 @@ var WeatherClient = class {
this._world = GWeather.Location.get_world();
this._providers = GWeather.Provider.METAR |
GWeather.Provider.YR_NO |
GWeather.Provider.OWM;
this._weatherInfo = new GWeather.Info({ enabled_providers: 0 });
let providers = GWeather.Provider.METAR |
GWeather.Provider.YR_NO |
GWeather.Provider.OWM;
this._weatherInfo = new GWeather.Info({ enabled_providers: providers });
this._weatherInfo.connect_after('updated', () => {
this._lastUpdate = GLib.DateTime.new_now_local();
this.emit('changed');
@ -216,8 +215,6 @@ var WeatherClient = class {
this._weatherInfo.set_location(location);
this._locationValid = location != null;
this._weatherInfo.set_enabled_providers(location ? this._providers : 0);
if (location)
this._loadInfo();
else