[libgweather/wip/hadess/serialisation-fix-stable: 2/13] weather: Consider moon phases to not be available for named timezones



commit d9a73ee41523449df84737ba94f4b0a2421391aa
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Oct 8 12:27:14 2018 +0200

    weather: Consider moon phases to not be available for named timezones
    
    Don't return a moon phase that's marked as valid for GWeatherLocations
    without a valid long/lat.

 libgweather/weather-moon.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/libgweather/weather-moon.c b/libgweather/weather-moon.c
index 993cdff..01466b1 100644
--- a/libgweather/weather-moon.c
+++ b/libgweather/weather-moon.c
@@ -141,6 +141,9 @@ _gweather_info_ensure_moon (GWeatherInfo *info)
 
     priv = info->priv;
 
+    if (!info->priv->location.latlon_valid)
+        return;
+
     if (!priv->moonValid)
        priv->moonValid = calc_moon_internal (priv->current_time,
                                              &priv->moonphase,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]