[Xfce4-commits] [panel-plugins/xfce4-weather-plugin] 01/01: Fix current astrodata updates.

noreply at xfce.org noreply at xfce.org
Sun Oct 19 09:25:41 CEST 2014


This is an automated email from the git hooks/post-receive script.

hjudt pushed a commit to branch master
in repository panel-plugins/xfce4-weather-plugin.

commit 8517e7c6b62fd932a89c9470ae27e3a837d74938
Author: Harald Judt <h.judt at gmx.at>
Date:   Thu Oct 16 20:07:09 2014 +0200

    Fix current astrodata updates.
    
    This should finally fix the current astrodata and related night/day
    icon update issue.
---
 panel-plugin/weather.c |   18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index 61395bd..e4cde3a 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -374,21 +374,23 @@ static void
 update_current_astrodata(plugin_data *data)
 {
     time_t now_t = time(NULL);
+    gdouble tdiff = -99999;
 
     if (G_UNLIKELY(data->astrodata == NULL)) {
         data->current_astro = NULL;
         return;
     }
 
-   if (data->current_astro == NULL ||
-       difftime(now_t, data->current_astro->day) >= 24 * 3600) {
-       data->current_astro = get_astro_data_for_day(data->astrodata, 0);
-       if (G_UNLIKELY(data->current_astro == NULL))
-           return;
+    if (data->current_astro)
+        tdiff = difftime(now_t, data->current_astro->day);
 
-       weather_debug("Updated current astrodata.");
-       weather_dump(weather_dump_astro, data->current_astro);
-   }
+    if (data->current_astro == NULL || tdiff >= 24 * 3600 || tdiff < 0) {
+        data->current_astro = get_astro_data_for_day(data->astrodata, 0);
+        if (G_UNLIKELY(data->current_astro == NULL))
+            weather_debug("No current astrodata available.");
+        else
+            weather_debug("Updated current astrodata.");
+    }
 }
 
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list