[gnome-panel] Fix clock crash when adding new location
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel] Fix clock crash when adding new location
- Date: Fri, 23 May 2014 14:29:15 +0000 (UTC)
commit c8677af8fa4c529ee2ef3e44d581fcc2ace0cc94
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Fri May 23 17:11:11 2014 +0300
Fix clock crash when adding new location
applets/clock/clock.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/applets/clock/clock.c b/applets/clock/clock.c
index 7126c6b..999b7e9 100644
--- a/applets/clock/clock.c
+++ b/applets/clock/clock.c
@@ -1440,7 +1440,7 @@ run_prefs_edit_save (GtkButton *button, ClockData *cd)
const gchar *timezone, *weather_code;
gchar *city, *name;
- GWeatherLocation *gloc;
+ GWeatherLocation *gloc, *station_loc;
gfloat lat = 0;
gfloat lon = 0;
@@ -1465,7 +1465,13 @@ run_prefs_edit_save (GtkButton *button, ClockData *cd)
return;
}
- weather_code = gweather_location_get_code (gloc);
+ station_loc = gloc;
+ while (gweather_location_get_level (station_loc) < GWEATHER_LOCATION_WEATHER_STATION) {
+ station_loc = gweather_location_get_children (station_loc)[0];
+ g_assert (station_loc != NULL);
+ }
+
+ weather_code = gweather_location_get_code (station_loc);
if (gweather_location_entry_has_custom_text (cd->location_entry)) {
name = gtk_editable_get_chars (GTK_EDITABLE (cd->location_entry), 0, -1);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]