[libgweather] GWeatherInfo: do not require weather conditions to access sun and moon data



commit bdd7b56438a669205e6a886046f20996ad549211
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sun Dec 2 20:36:54 2012 +0100

    GWeatherInfo: do not require weather conditions to access sun and moon data
    
    That data is computed offline from the current time and geographical
    coordinates, we don't need a valid METAR response.

 libgweather/weather.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/libgweather/weather.c b/libgweather/weather.c
index d39ad66..98585dd 100644
--- a/libgweather/weather.c
+++ b/libgweather/weather.c
@@ -1036,9 +1036,6 @@ gweather_info_get_icon_name (GWeatherInfo *info)
 
     priv = info->priv;
 
-    if (!priv->valid)
-        return NULL;
-
     _gweather_info_ensure_sun (info);
     _gweather_info_ensure_moon (info);
 
@@ -1527,7 +1524,7 @@ gweather_info_get_value_sunrise (GWeatherInfo *info, time_t *value)
 
     _gweather_info_ensure_sun (info);
 
-    if (!info->priv->valid || !info->priv->sunriseValid)
+    if (!info->priv->sunriseValid)
 	return FALSE;
 
     *value = info->priv->sunrise;
@@ -1550,7 +1547,7 @@ gweather_info_get_value_sunset (GWeatherInfo *info, time_t *value)
 
     _gweather_info_ensure_sun (info);
 
-    if (!info->priv->valid || !info->priv->sunsetValid)
+    if (!info->priv->sunsetValid)
 	return FALSE;
 
     *value = info->priv->sunset;
@@ -1577,7 +1574,7 @@ gweather_info_get_value_moonphase (GWeatherInfo      *info,
 
     _gweather_info_ensure_moon (info);
 
-    if (!info->priv->valid || !info->priv->moonValid)
+    if (!info->priv->moonValid)
 	return FALSE;
 
     *value = info->priv->moonphase;



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