[Xfce4-commits] <xfce4-weather-plugin:master> Do not cache timezone.

Harald Judt noreply at xfce.org
Fri Feb 1 16:20:04 CET 2013


Updating branch refs/heads/master
         to bdb0324514f225eba8d23961ed401af922f108a4 (commit)
       from 22f612278466f00a95f2b41d093c04568fd0897b (commit)

commit bdb0324514f225eba8d23961ed401af922f108a4
Author: Harald Judt <h.judt at gmx.at>
Date:   Thu Jan 31 15:53:10 2013 +0100

    Do not cache timezone.
    
    The times stored in the cache file are all UTC, so caching this value is useless.

 panel-plugin/weather.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index 30ba298..6ffe5d6 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -989,9 +989,6 @@ write_cache_file(plugin_data *data)
     CACHE_APPEND("lon=%s\n", data->lon);
     g_string_append_printf(out, "msl=%d\n", data->msl);
     g_string_append_printf(out, "timeslices=%d\n", wd->timeslices->len);
-    value = double_to_string(data->timezone, "%.1f");
-    CACHE_APPEND("timezone=%s\n", value);
-    g_free(value);
     if (G_LIKELY(data->weather_update)) {
         value = format_date(data->weather_update->last, date_format, FALSE);
         CACHE_APPEND("last_weather_download=%s\n", value);
@@ -1095,7 +1092,7 @@ read_cache_file(plugin_data *data)
     struct tm cache_date_tm;
     gchar *file, *locname = NULL, *lat = NULL, *lon = NULL, *group = NULL;
     gchar *timestring;
-    gdouble timezone, diff;
+    gdouble diff;
     gint msl, num_timeslices = 0, i, j;
 
     g_assert(data != NULL);
@@ -1137,12 +1134,10 @@ read_cache_file(plugin_data *data)
     }
     msl = g_key_file_get_integer(keyfile, group, "msl", err);
     if (!err)
-        timezone = g_key_file_get_double(keyfile, group, "timezone", err);
-    if (!err)
         num_timeslices = g_key_file_get_integer(keyfile, group,
                                                 "timeslices", err);
     if (err || strcmp(lat, data->lat) || strcmp(lon, data->lon) ||
-        msl != data->msl || timezone != data->timezone || num_timeslices < 1) {
+        msl != data->msl || num_timeslices < 1) {
         CACHE_FREE_VARS();
         weather_debug("The required values are not present in the cache file "
                       "or do not match the current plugin data. Reading "


More information about the Xfce4-commits mailing list