[libgweather/wip/hadess/fixes: 8/13] gweather: Don't do network I/O when calling gweather_info_new()
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgweather/wip/hadess/fixes: 8/13] gweather: Don't do network I/O when calling gweather_info_new()
- Date: Tue, 12 Jan 2021 09:53:05 +0000 (UTC)
commit 18733aafa0020292aa723ab3b775c91bd9024e46
Author: Bastien Nocera <hadess hadess net>
Date: Mon Jan 11 17:38:11 2021 +0100
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.
libgweather/gweather-weather.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
---
diff --git a/libgweather/gweather-weather.c b/libgweather/gweather-weather.c
index 70701997..651aedc3 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 *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]