[libgweather/gnome-3-36] weather: Add helper to copy forecast data between GWeatherInfo



commit 7c43f4049a59a98c40e7de15063f095b98a6769c
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Jun 19 12:31:07 2020 +0200

    weather: Add helper to copy forecast data between GWeatherInfo

 libgweather/gweather-weather.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
---
diff --git a/libgweather/gweather-weather.c b/libgweather/gweather-weather.c
index 1f0ae25d..2ac0cd07 100644
--- a/libgweather/gweather-weather.c
+++ b/libgweather/gweather-weather.c
@@ -323,6 +323,26 @@ _gweather_info_begin_request (GWeatherInfo *info,
     g_object_ref (message);
 }
 
+static void
+copy_weather_data (GWeatherInfo *src,
+                  GWeatherInfo *dest)
+{
+  dest->priv->hasHumidity = src->priv->hasHumidity;
+  dest->priv->update = src->priv->update;
+  dest->priv->current_time = src->priv->current_time;
+  dest->priv->sky = src->priv->sky;
+  dest->priv->cond = src->priv->cond;
+  dest->priv->temp = src->priv->temp;
+  dest->priv->temp_min = src->priv->temp_min;
+  dest->priv->temp_max = src->priv->temp_max;
+  dest->priv->dew = src->priv->dew;
+  dest->priv->humidity = src->priv->humidity;
+  dest->priv->wind = src->priv->wind;
+  dest->priv->windspeed = src->priv->windspeed;
+  dest->priv->pressure = src->priv->pressure;
+  dest->priv->visibility = src->priv->visibility;
+}
+
 void
 _gweather_info_request_done (GWeatherInfo *info,
                             SoupMessage  *message)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]