[Xfce4-commits] [panel-plugins/xfce4-weather-plugin] 05/05: Fix astrodata being wrong after a location change.

noreply at xfce.org noreply at xfce.org
Thu Oct 23 13:19:29 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 4a53bb4ce2467f6da2826664f918544396e75f58
Author: Harald Judt <h.judt at gmx.at>
Date:   Wed Oct 22 21:40:01 2014 +0200

    Fix astrodata being wrong after a location change.
    
    This commit fixes the following bug:
    
    1) Add weather plugin instance to the panel and open its configuration dialog.
    2) Let the plugin autodetect its location and finish downloading of data.
    3) Choose for a new location (maybe even in another timezone).
    4) Wait for data download to finish, then look at the sunrise/sunset data,
       e.g. in the tooltip and notice it is wrong.
---
 panel-plugin/weather.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index 79e7ef4..fff24e0 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -1411,13 +1411,19 @@ update_weatherdata_with_reset(plugin_data *data)
         data->weatherdata = make_weather_data();
     }
 
+    /* clear existing astronomical data */
+    if (data->astrodata) {
+        astrodata_free(data->astrodata);
+        data->astrodata = g_array_sized_new(FALSE, TRUE, sizeof(xml_astro *), 30);
+    }
+
     /* update GUI to display NODATA */
     update_icon(data);
     update_scrollbox(data, TRUE);
 
     /* make use of previously saved data */
     read_cache_file(data);
-    update_current_astrodata(data);
+    update_current_conditions(data, TRUE);
 
     /* schedule downloads immediately */
     time(&now_t);

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


More information about the Xfce4-commits mailing list