summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2021-01-11 17:38:11 +0100
committerBastien Nocera <hadess@hadess.net>2021-01-12 10:47:52 +0100
commit18733aafa0020292aa723ab3b775c91bd9024e46 (patch)
treea565f7eefaea6dabe24a64262b48329d545dee4e
parent28bb4b2f012500cafaf9dfb35073f669bc89cc7b (diff)
downloadlibgweather-18733aafa0020292aa723ab3b775c91bd9024e46.tar.gz
gweather: Don't do network I/O when calling gweather_info_new()
The old code used to start doing network I/O when we didn't even have the enabled-providers set.
-rw-r--r--libgweather/gweather-weather.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/libgweather/gweather-weather.c b/libgweather/gweather-weather.c
index 7070199..651aedc 100644
--- a/libgweather/gweather-weather.c
+++ b/libgweather/gweather-weather.c
@@ -2249,20 +2249,18 @@ gweather_info_class_init (GWeatherInfoClass *klass)
* Builds a new #GWeatherInfo that will provide weather information about
* @location.
*
+ * Since version 40, this does not automatically call gweather_info_update().
+ * gweather_info_update() must be called manually once all the necessary set up
+ * has been made, such as setting the enabled providers.
+ *
* Returns: (transfer full): a new #GWeatherInfo
*/
GWeatherInfo *
-gweather_info_new (GWeatherLocation *location)
+gweather_info_new (GWeatherLocation *location)
{
- GWeatherInfo *self;
-
if (location != NULL)
- self = g_object_new (GWEATHER_TYPE_INFO, "location", location, NULL);
- else
- self = g_object_new (GWEATHER_TYPE_INFO, NULL);
-
- gweather_info_update (self);
- return self;
+ return g_object_new (GWEATHER_TYPE_INFO, "location", location, NULL);
+ return g_object_new (GWEATHER_TYPE_INFO, NULL);
}
GWeatherInfo *