[libgweather/wip/hadess/fixes: 9/13] gweather: Fix _gweather_info_new_clone() not copying all properties




commit e546754bd7d5f5c99006eb1d0151d75e3436a23a
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Jan 11 17:42:18 2021 +0100

    gweather: Fix _gweather_info_new_clone() not copying all properties
    
    Make sure to also copy the "enabled-providers" property when cloning the
    info object.

 libgweather/gweather-weather.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/libgweather/gweather-weather.c b/libgweather/gweather-weather.c
index 651aedc3..918bc8ab 100644
--- a/libgweather/gweather-weather.c
+++ b/libgweather/gweather-weather.c
@@ -2266,6 +2266,9 @@ gweather_info_new (GWeatherLocation *location)
 GWeatherInfo *
 _gweather_info_new_clone (GWeatherInfo *other)
 {
-    return g_object_new (GWEATHER_TYPE_INFO, "location", other->glocation, NULL);
+    return g_object_new (GWEATHER_TYPE_INFO,
+                         "location", other->glocation,
+                         "enabled-providers", other->providers,
+                         NULL);
 }
 


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