[Xfce4-commits] <xfce4-weather-plugin:master> Fix reading/writing wind dir name and clouds values.

Harald Judt noreply at xfce.org
Fri Dec 14 16:42:01 CET 2012


Updating branch refs/heads/master
         to 40fd60c61f931ec9e4e5dc6d9d37e86d92394e04 (commit)
       from 775ccced0174c8efedaf3468ac049e472f86ba4b (commit)

commit 40fd60c61f931ec9e4e5dc6d9d37e86d92394e04
Author: Harald Judt <h.judt at gmx.at>
Date:   Fri Dec 14 16:37:41 2012 +0100

    Fix reading/writing wind dir name and clouds values.
    
    GKeyFile does not support using brackets [] in key names, so reading the
    clouds values did never work.

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

diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index 26cc992..fd096e2 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -943,7 +943,7 @@ write_cache_file(plugin_data *data)
         g_free(point);
         for (j = 0; j < CLOUDS_PERC_NUM; j++)
             if (loc->clouds_percent[j])
-                g_string_append_printf(out, "clouds_percent[%d]=%s\n", j,
+                g_string_append_printf(out, "clouds_percent_%d=%s\n", j,
                                        loc->clouds_percent[j]);
         CACHE_APPEND("fog_percent=%s\n", loc->fog_percent);
         CACHE_APPEND("precipitation_value=%s\n", loc->precipitation_value);
@@ -1072,6 +1072,7 @@ read_cache_file(plugin_data *data)
         CACHE_READ_STRING(loc->longitude, "longitude");
         CACHE_READ_STRING(loc->temperature_value, "temperature_value");
         CACHE_READ_STRING(loc->temperature_unit, "temperature_unit");
+        CACHE_READ_STRING(loc->wind_dir_name, "wind_dir_name");
         CACHE_READ_STRING(loc->wind_dir_deg, "wind_dir_deg");
         CACHE_READ_STRING(loc->wind_speed_mps, "wind_speed_mps");
         CACHE_READ_STRING(loc->wind_speed_beaufort, "wind_speed_beaufort");
@@ -1081,7 +1082,7 @@ read_cache_file(plugin_data *data)
         CACHE_READ_STRING(loc->pressure_unit, "pressure_unit");
 
         for (j = 0; j < CLOUDS_PERC_NUM; j++) {
-            gchar *key = g_strdup_printf("clouds_percent[%d]", j);
+            gchar *key = g_strdup_printf("clouds_percent_%d", j);
             if (g_key_file_has_key(keyfile, group, key, NULL))
                 loc->clouds_percent[j] =
                     g_key_file_get_string(keyfile, group, key, NULL);


More information about the Xfce4-commits mailing list