[gnome-clocks] search-provider: Workaround for crashes in gweather_location_serialize



commit 9ba5fbac1181b8c3b6e961a9c23d268febef1346
Author: Yanko Kaneti <yaneti declera com>
Date:   Wed Feb 21 18:30:48 2018 +0200

    search-provider: Workaround for crashes in gweather_location_serialize
    
    gweather_location_serialize is currenty not ready to serialize cities
    without children weather stations eg: Warangal
    
    Skip those until we either get better serialization handling of those
    in libgweather or we change how we produce the data for the search
    provider interface
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1546666

 src/search-provider.vala |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/search-provider.vala b/src/search-provider.vala
index a6c44d3..f9d3d83 100644
--- a/src/search-provider.vala
+++ b/src/search-provider.vala
@@ -94,6 +94,11 @@ public class SearchProvider : Object {
 
         string[] result = {};
         matches.foreach ((location) => {
+            // FIXME: Avoid cities without children locations
+            if (location.get_level () == GWeather.LocationLevel.CITY &&
+                location.get_children().length == 0) {
+                return;
+            }
             // HACK: the search provider interface does not currently allow variants as result IDs
             result += serialize_location (location);
         });


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