Updating branch refs/heads/master
         to 345f18d34e76630f1d539db5ffb6e8526de2af7d (commit)
       from 23ee4dc71f77e77329acd97e0a3abb1cd6bd9f6a (commit)

commit 345f18d34e76630f1d539db5ffb6e8526de2af7d
Author: Harald Judt <h.j...@gmx.at>
Date:   Tue Jul 17 15:21:50 2012 +0200

    Cosmetic fix for formatting label data.
    
    There should be no space between the value and the degrees (°) sign,
    e.g. "WD: 290,9 °" ==> "WD: 290,9°"
    
    It's already correct in the forecast details tab.

 panel-plugin/weather.c |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index 22fcd78..4ab363b 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -119,7 +119,7 @@ make_label (xfceweather_data *data,
 {
   gchar       *str, *value, *rawvalue;
   xml_time    *conditions;
-  const gchar *lbl, *txtsize;
+  const gchar *lbl, *txtsize, *unit;
 
   switch (opt)
     {
@@ -189,26 +189,30 @@ make_label (xfceweather_data *data,
   if (data->labels->len > 1) {
     if (value != NULL)
       {
-       str = g_strdup_printf ("<span size=\"%s\">%s: %s</span>",
+        str = g_strdup_printf ("<span size=\"%s\">%s: %s</span>",
                                txtsize, lbl, value);
-       g_free (value);
+        g_free (value);
       }
     else
       {
-       str = g_strdup_printf ("<span size=\"%s\">%s: %s %s</span>",
-                               txtsize, lbl, rawvalue, get_unit (conditions, 
data->unit_system, opt));
+        unit = get_unit (conditions, data->unit_system, opt);
+        str = g_strdup_printf ("<span size=\"%s\">%s: %s%s%s</span>",
+                               txtsize, lbl, rawvalue,
+                               strcmp(unit, "°") ? " " : "", unit);
       }
   } else {
     if (value != NULL)
       {
-       str = g_strdup_printf ("<span size=\"%s\">%s</span>",
-                               txtsize, value);
-       g_free (value);
+          str = g_strdup_printf ("<span size=\"%s\">%s</span>",
+                                 txtsize, value);
+          g_free (value);
       }
     else
       {
-       str = g_strdup_printf ("<span size=\"%s\">%s %s</span>",
-                               txtsize, rawvalue, get_unit (conditions, 
data->unit_system, opt));
+        unit = get_unit (conditions, data->unit_system, opt);
+        str = g_strdup_printf ("<span size=\"%s\">%s%s%s</span>",
+                               txtsize, rawvalue,
+                               strcmp(unit, "°") ? " " : "", unit);
       }
   }
   g_free (rawvalue);
_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits

Reply via email to