[Xfce4-commits] <xfce4-weather-plugin:master> Rename timeslice to conditions to reflect recent changes.

Harald Judt noreply at xfce.org
Fri Jul 13 16:50:06 CEST 2012


Updating branch refs/heads/master
         to 64cfb8ef86d3df91449ae06963d4f3a06b682c7d (commit)
       from e86cff008bd00d502cd88aea29e2b9edf2c5f511 (commit)

commit 64cfb8ef86d3df91449ae06963d4f3a06b682c7d
Author: Harald Judt <h.judt at gmx.at>
Date:   Wed Jul 11 13:16:28 2012 +0200

    Rename timeslice to conditions to reflect recent changes.
    
    Now that we're dealing with combined instead of simple timeslices,
    make these changes evident by renaming the variables to something
    more reminiscent of "weather".

 panel-plugin/weather-summary.c |   32 ++++++++++++++++----------------
 panel-plugin/weather.c         |   32 ++++++++++++++++----------------
 2 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/panel-plugin/weather-summary.c b/panel-plugin/weather-summary.c
index 3d6cd06..12f4865 100644
--- a/panel-plugin/weather-summary.c
+++ b/panel-plugin/weather-summary.c
@@ -41,8 +41,8 @@ static gboolean lnk_clicked (GtkTextTag *tag, GObject *obj,
 #define APPEND_TEXT_ITEM_REAL(text)      gtk_text_buffer_insert(GTK_TEXT_BUFFER(buffer), \
                                                                 &iter, text, -1);\
                                          g_free (value);
-#define APPEND_TEXT_ITEM(text, item)     rawvalue = get_data(timeslice, data->unit, item); \
-                                         unit = get_unit(timeslice, data->unit, item); \
+#define APPEND_TEXT_ITEM(text, item)     rawvalue = get_data(conditions, data->unit, item); \
+                                         unit = get_unit(conditions, data->unit, item); \
                                          value = g_strdup_printf("\t%s%s%s%s%s\n", \
                                                                  text, text ? ": " : "", \
                                                                  rawvalue, \
@@ -241,7 +241,7 @@ create_summary_tab (xfceweather_data *data)
   GdkColor       lnk_color;
   GtkAdjustment *adj;
   GtkWidget     *weather_channel_icon;
-  xml_time      *timeslice;
+  xml_time      *conditions;
   struct tm     *start, *end, *point_tm;
   char           interval_start[80], interval_end[80], point[80];
 
@@ -274,21 +274,21 @@ create_summary_tab (xfceweather_data *data)
   APPEND_BTEXT (value);
   g_free (value);
 
-  timeslice = get_current_conditions(data->weatherdata);
+  conditions = get_current_conditions(data->weatherdata);
   APPEND_BTEXT(_("Coordinates\n"));
   APPEND_TEXT_ITEM (_("Altitude"), ALTITUDE);
   APPEND_TEXT_ITEM (_("Latitude"), LATITUDE);
   APPEND_TEXT_ITEM (_("Longitude"), LONGITUDE);
 
   APPEND_BTEXT(_("\nTime\n"));
-  point_tm = localtime(&timeslice->point);
+  point_tm = localtime(&conditions->point);
   strftime (point, 80, "%c", point_tm);
   value = g_strdup_printf (_("\tPoint data applies to:\n\t%s\n"), point);
   APPEND_TEXT_ITEM_REAL (value);
 
-  start = localtime(&timeslice->start);
+  start = localtime(&conditions->start);
   strftime (interval_start, 80, "%c", start);
-  end = localtime(&timeslice->end);
+  end = localtime(&conditions->end);
   strftime (interval_end, 80, "%c", end);
   value = g_strdup_printf (_("\n\tInterval data applies to:\n\t%s\n\t%s\n"),
                            interval_start,
@@ -306,22 +306,22 @@ create_summary_tab (xfceweather_data *data)
 
   /* Wind */
   APPEND_BTEXT (_("\nWind\n"));
-  rawvalue = get_data (timeslice, data->unit, WIND_SPEED);
-  wind = translate_wind_speed (timeslice, rawvalue, data->unit);
+  rawvalue = get_data (conditions, data->unit, WIND_SPEED);
+  wind = translate_wind_speed (conditions, rawvalue, data->unit);
   g_free (rawvalue);
-  rawvalue = get_data (timeslice, data->unit, WIND_BEAUFORT);
+  rawvalue = get_data (conditions, data->unit, WIND_BEAUFORT);
   value = g_strdup_printf (_("\t%s: %s (%s on the Beaufort scale)\n"), _("Speed"), wind, rawvalue);
   g_free (rawvalue);
   g_free (wind);
   APPEND_TEXT_ITEM_REAL (value);
 
-  rawvalue = get_data (timeslice, data->unit, WIND_DIRECTION);
+  rawvalue = get_data (conditions, data->unit, WIND_DIRECTION);
   wind = translate_wind_direction (rawvalue);
   g_free (rawvalue);
-  rawvalue = get_data (timeslice, data->unit, WIND_DIRECTION_DEG);
+  rawvalue = get_data (conditions, data->unit, WIND_DIRECTION_DEG);
   value = g_strdup_printf ("\t%s: %s (%s%s)\n", _("Direction"),
                            wind, rawvalue,
-                           get_unit (timeslice, data->unit, WIND_DIRECTION_DEG));
+                           get_unit (conditions, data->unit, WIND_DIRECTION_DEG));
   g_free (rawvalue);
   g_free (wind);
   APPEND_TEXT_ITEM_REAL (value);
@@ -554,7 +554,7 @@ create_summary_window (xfceweather_data *data)
   GtkWidget *window, *notebook, *vbox, *hbox, *label;
   gchar     *title, *rawvalue;
   GdkPixbuf *icon;
-  xml_time  *timeslice;
+  xml_time  *conditions;
 
   window = xfce_titled_dialog_new_with_buttons (_("Weather Update"),
                                                 NULL,
@@ -573,9 +573,9 @@ create_summary_window (xfceweather_data *data)
   gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE,
                       0);
 
-  timeslice = get_current_conditions(data->weatherdata);
+  conditions = get_current_conditions(data->weatherdata);
 
-  rawvalue = get_data (timeslice, data->unit, SYMBOL);
+  rawvalue = get_data (conditions, data->unit, SYMBOL);
   icon = get_icon (rawvalue, 48, is_night_time());
   g_free (rawvalue);
 
diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index a0d3c24..cc42d38 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -101,7 +101,7 @@ make_label (xml_weather    *weatherdata,
 	    gboolean       multiple_labels)
 {
   gchar       *str, *value, *rawvalue;
-  xml_time    *timeslice;
+  xml_time    *conditions;
   const gchar *lbl, *txtsize;
 
   switch (opt)
@@ -156,9 +156,9 @@ make_label (xml_weather    *weatherdata,
   else
     txtsize = "xx-small";
 
-  /* get data from current timeslice */
-  timeslice = get_current_conditions(weatherdata);
-  rawvalue = get_data(timeslice, unit, opt);
+  /* get current weather conditions */
+  conditions = get_current_conditions(weatherdata);
+  rawvalue = get_data(conditions, unit, opt);
 
   switch (opt)
     {
@@ -166,7 +166,7 @@ make_label (xml_weather    *weatherdata,
       value = translate_wind_direction (rawvalue);
       break;
     case WIND_SPEED:
-      value = translate_wind_speed (timeslice, rawvalue, unit);
+      value = translate_wind_speed (conditions, rawvalue, unit);
       break;
     default:
       value = NULL;
@@ -184,7 +184,7 @@ make_label (xml_weather    *weatherdata,
     else
       {
 	str = g_strdup_printf ("<span size=\"%s\">%s: %s %s</span>",
-                               txtsize, lbl, rawvalue, get_unit (timeslice, unit, opt));
+                               txtsize, lbl, rawvalue, get_unit (conditions, unit, opt));
       }
   } else {
     if (value != NULL)
@@ -196,7 +196,7 @@ make_label (xml_weather    *weatherdata,
     else
       {
 	str = g_strdup_printf ("<span size=\"%s\">%s %s</span>",
-                               txtsize, rawvalue, get_unit (timeslice, unit, opt));
+                               txtsize, rawvalue, get_unit (conditions, unit, opt));
       }
   }
   g_free (rawvalue);
@@ -271,7 +271,7 @@ set_icon_error (xfceweather_data *data)
 static void
 set_icon_current (xfceweather_data *data)
 {
-  xml_time       *timeslice;
+  xml_time       *conditions;
   guint           i;
   GdkPixbuf      *icon = NULL;
   datas           opt;
@@ -312,11 +312,11 @@ set_icon_current (xfceweather_data *data)
 #endif
     }
  
-  /* get data from current timeslice */
-  timeslice = get_current_conditions(data->weatherdata);
+  /* get current weather conditions */
+  conditions = get_current_conditions(data->weatherdata);
   nighttime = is_night_time();
 
-  str = get_data (timeslice, data->unit, SYMBOL);
+  str = get_data (conditions, data->unit, SYMBOL);
   icon = get_icon (str, size, nighttime);
   g_free (str);
  
@@ -326,7 +326,7 @@ set_icon_current (xfceweather_data *data)
     g_object_unref (G_OBJECT (icon));
 
 #if !GTK_CHECK_VERSION(2,12,0)
-  str = get_data (timeslice, data->unit, SYMBOL);
+  str = get_data (conditions, data->unit, SYMBOL);
   gtk_tooltips_set_tip (data->tooltips, data->tooltipbox,
                         translate_desc (str, nighttime),
                         NULL);
@@ -802,15 +802,15 @@ static gboolean weather_get_tooltip_cb (GtkWidget        *widget,
 {
   GdkPixbuf *icon;
   gchar *markup_text, *rawvalue;
-  xml_time *timeslice;
+  xml_time *conditions;
   gboolean nighttime;
 
-  timeslice = get_current_conditions(data->weatherdata);
+  conditions = get_current_conditions(data->weatherdata);
   nighttime = is_night_time();
   if (data->weatherdata == NULL) {
     gtk_tooltip_set_text (tooltip, _("Cannot update weather data"));
   } else {
-    rawvalue = get_data (timeslice, data->unit, SYMBOL);
+    rawvalue = get_data (conditions, data->unit, SYMBOL);
     markup_text = g_markup_printf_escaped(
   	  "<b>%s</b>\n"
 	  "%s",
@@ -822,7 +822,7 @@ static gboolean weather_get_tooltip_cb (GtkWidget        *widget,
     g_free(markup_text);
   }
 
-  rawvalue = get_data (timeslice, data->unit, SYMBOL);
+  rawvalue = get_data (conditions, data->unit, SYMBOL);
   icon = get_icon (rawvalue, 32, nighttime);
   g_free (rawvalue);
   gtk_tooltip_set_icon (tooltip, icon);


More information about the Xfce4-commits mailing list