Updating branch refs/heads/master
         to 5c0fd23d5b86114bba33bfd5eb798f0313dcadae (commit)
       from a20c1e82b8ddfc3bafa423ec48602916ea3e571c (commit)

commit 5c0fd23d5b86114bba33bfd5eb798f0313dcadae
Author: Harald Judt <[email protected]>
Date:   Wed Dec 19 09:03:40 2012 +0100

    Time for more fog.
    
    It seems met.no doesn't use the FOG symbol at all?
    Let's try to safely make use of it by analysing the fog value
    and the other values, and choose it if it seems right to do so
    (it's still low priority, but not that much low priority as
    before).

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

diff --git a/panel-plugin/weather-data.c b/panel-plugin/weather-data.c
index 8f984db..fb31f35 100644
--- a/panel-plugin/weather-data.c
+++ b/panel-plugin/weather-data.c
@@ -433,7 +433,7 @@ static void
 calculate_symbol(xml_time *timeslice)
 {
     xml_location *loc;
-    gdouble cloudiness, precipitation;
+    gdouble fog, cloudiness, precipitation;
 
     g_assert(timeslice != NULL && timeslice->location != NULL);
     if (G_UNLIKELY(timeslice == NULL || timeslice->location == NULL))
@@ -454,6 +454,10 @@ calculate_symbol(xml_time *timeslice)
     else if (cloudiness >= 1.0 / 8.0)
         loc->symbol_id = SYMBOL_LIGHTCLOUD;
 
+    fog = string_to_double(loc->fog_percent, 0);
+    if (fog >= 80)
+        loc->symbol_id = SYMBOL_FOG;
+
     /* update symbol name */
     g_free(loc->symbol);
     loc->symbol = g_strdup(symbol_by_id(loc->symbol_id));
_______________________________________________
Xfce4-commits mailing list
[email protected]
https://mail.xfce.org/mailman/listinfo/xfce4-commits

Reply via email to