diff options
author | Bastien Nocera <hadess@hadess.net> | 2021-01-12 12:06:28 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2021-01-12 15:11:55 +0100 |
commit | 6deeb6eb6db1db0b5f0938a47a998e29bdc7b9d4 (patch) | |
tree | 2ad54ed0b25db2c46b2552543a034c6178ec77f2 | |
parent | c11ee04fd482f154f2961eed8ea607e1b42d7377 (diff) | |
download | libgweather-6deeb6eb6db1db0b5f0938a47a998e29bdc7b9d4.tar.gz |
gweather: Require an app id to enable weather providers
And mention that in the gweather_info_set_application_id() API doc.
-rw-r--r-- | libgweather/gweather-weather.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libgweather/gweather-weather.c b/libgweather/gweather-weather.c index 2ae8af4..3fa4283 100644 --- a/libgweather/gweather-weather.c +++ b/libgweather/gweather-weather.c @@ -2153,6 +2153,11 @@ gweather_info_set_enabled_providers (GWeatherInfo *info, { g_return_if_fail (GWEATHER_IS_INFO (info)); + if (providers != GWEATHER_PROVIDER_NONE) { + g_return_if_fail (info->application_id != NULL); + g_return_if_fail (g_application_id_is_valid (info->application_id)); + } + if (info->providers == providers) return; @@ -2186,7 +2191,8 @@ gweather_info_get_application_id (GWeatherInfo *info) * @application_id: the application ID to set * * Sets the [application ID](https://docs.flatpak.org/en/latest/conventions.html#application-ids) - * of the application fetching the weather. + * of the application fetching the weather. It is a requirement + * for using any of the online weather providers. * * If the application uses #GApplication, then the application ID * will be automatically filled in. |