From 19c22dc7188c247d489bc4b97513a22198141614 Mon Sep 17 00:00:00 2001 From: Konstantin Pugin Date: Sun, 26 Apr 2015 19:25:12 +0600 Subject: [PATCH] fixed weather crash again --- applets/weather/weather.vala | 7 +++---- data/gschemas/org.valapanel.weather.gschema.xml | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/applets/weather/weather.vala b/applets/weather/weather.vala index 3e5edf4..3e62737 100644 --- a/applets/weather/weather.vala +++ b/applets/weather/weather.vala @@ -117,6 +117,8 @@ namespace Weather { var loc = settings.get_value(LOCATIONS); current_location = settings.get_uint(CURRENT_LOC); + if (loc.n_children() < 1) + return; locations = new GWeather.Location[(int)loc.n_children()]; foreach(var item in location_items) dbusmenu.remove_item(item.id); @@ -137,10 +139,7 @@ namespace Weather }); dbusmenu.prepend_item(location_items[i]); } - if (location_items.length > 0) - info.location = locations[current_location]; - else - info.location = GWeather.Location.get_world(); + info.location = locations[current_location]; info.abort(); info.update(); dbusmenu.layout_updated(layout_revision++,0); diff --git a/data/gschemas/org.valapanel.weather.gschema.xml b/data/gschemas/org.valapanel.weather.gschema.xml index c3c5a28..35ced7e 100644 --- a/data/gschemas/org.valapanel.weather.gschema.xml +++ b/data/gschemas/org.valapanel.weather.gschema.xml @@ -1,7 +1,7 @@ - [<(uint32 2, <('Omsk', 'UNOO', true, [(0.95934931799731404, 1.2793263417118435)], [(0.95993108859688125, 1.2810716709638379)])>)>] + [] 0