From fd2588484f46784b87881626d598c7b6fe8712c7 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Fri, 7 Mar 2003 19:46:38 +0000 Subject: Add some escapes to the newly added locations so they get split properly. * Locations (name): Add some escapes to the newly added locations so they get split properly. * e-summary-weather.c (e_summary_weather_init_locations): Fetch the Locations file from the right path. If you find an invalid entry in the Locations file, complain with an informative g_warning() instead of just returning FALSE. (e_summary_weather_fill_etable): Do the same thing here. svn path=/trunk/; revision=20220 --- my-evolution/ChangeLog | 17 +++++++++++++++++ my-evolution/Locations | 6 +++--- my-evolution/e-summary-weather.c | 32 +++++++++++++++----------------- 3 files changed, 35 insertions(+), 20 deletions(-) diff --git a/my-evolution/ChangeLog b/my-evolution/ChangeLog index a7009c5a0e..67605633f9 100644 --- a/my-evolution/ChangeLog +++ b/my-evolution/ChangeLog @@ -1,3 +1,20 @@ +2003-03-07 Ettore Perazzoli + + * Locations (name): Add some escapes to the newly added locations + so they get split properly. + + * e-summary-weather.c (e_summary_weather_init_locations): Fetch + the Locations file from the right path. If you find an invalid + entry in the Locations file, complain with an informative + g_warning() instead of just returning FALSE. + (e_summary_weather_fill_etable): Do the same thing here. + +2003-03-06 Ettore Perazzoli + + * e-summary-calendar.c (generate_html): Added the AM/PM part when + not in "wants24hr" mode; moved the date before the time instead of + vice versa. Also, do not check the boolean value against TRUE! + 2003-03-06 Ettore Perazzoli * Locations: Added more Swedish locations, submitted by Marten diff --git a/my-evolution/Locations b/my-evolution/Locations index 2f3025e5c2..c7d42f2298 100644 --- a/my-evolution/Locations +++ b/my-evolution/Locations @@ -1945,13 +1945,13 @@ loc2=Portoroz LJPZ ------ --- [EU_SE] name=Sweden loc0=Borlange ESSD ------ -- -loc1=Gavle \\ Sandviken ESSK ------ -- +loc1=Gavle\\ Sandviken ESSK ------ -- loc2=Gallivare ESNG ------ -- loc3=Goteborg\\ (Landvetter) ESGG ------ -- loc4=Goteborg\\ (Save) ESGP ------ -- loc5=Hagshult ESMV ------ -- -loc6=Halmstad\\ (Swedish Air Force Base) ESMT ------ -- -loc7=Hultsfred\\(Swedish Air Force Base) ESSF ------ -- +loc6=Halmstad\\ (Swedish\\ Air\\ Force\\ Base) ESMT ------ -- +loc7=Hultsfred\\ (Swedish\\ Air\\ Force\\ Base) ESSF ------ -- loc8=Jonkoping ESGJ ------ --- loc9=Kiruna ESNQ ------ --- loc10=Linkoping\\ (Malmen) ESCF ------ -- diff --git a/my-evolution/e-summary-weather.c b/my-evolution/e-summary-weather.c index f6071f32f7..00dbb25198 100644 --- a/my-evolution/e-summary-weather.c +++ b/my-evolution/e-summary-weather.c @@ -368,7 +368,6 @@ e_summary_weather_add_location (ESummary *summary, static gboolean e_summary_weather_init_locations (void) { - char *key, *path; int nregions, iregions; char **regions; @@ -377,13 +376,8 @@ e_summary_weather_init_locations (void) } locations_hash = g_hash_table_new (g_str_hash, g_str_equal); - path = g_strdup (LOCATIONDIR); - key = g_strdup_printf ("=%s=/", path); - g_free (path); - - gnome_config_push_prefix (key); - g_free (key); + gnome_config_push_prefix ("=" LOCATIONDIR "/Locations=/"); gnome_config_get_vector ("Main/regions", &nregions, ®ions); for (iregions = nregions - 1; iregions >= 0; iregions--) { @@ -419,7 +413,13 @@ e_summary_weather_init_locations (void) gnome_config_make_vector (iter_val, &nlocdata, &locdata); - g_return_val_if_fail (nlocdata == 4, FALSE); + + if (nlocdata != 4) { + g_warning ("Invalid location in Locations file: %s\n", iter_val); + g_free (iter_key); + g_free (iter_val); + continue; + } if (!g_hash_table_lookup (locations_hash, locdata[1])) { location = weather_location_new (locdata); @@ -660,17 +660,10 @@ e_summary_weather_fill_etable (ESummaryShown *ess) { ETreePath region, state, location; ESummaryShownModelEntry *entry; - char *key, *path; int nregions, iregions; char **regions; - path = g_strdup (LOCATIONDIR); - - key = g_strdup_printf ("=%s=/", path); - g_free (path); - - gnome_config_push_prefix (key); - g_free (key); + gnome_config_push_prefix ("=" LOCATIONDIR "/Locations=/"); gnome_config_get_vector ("Main/regions", &nregions, ®ions); region = NULL; @@ -722,7 +715,12 @@ e_summary_weather_fill_etable (ESummaryShown *ess) gnome_config_make_vector (iter_val, &nlocdata, &locdata); - g_return_if_fail (nlocdata == 4); + if (nlocdata != 4) { + g_warning ("Invalid location in Locations file: %s\n", iter_val); + g_free (iter_key); + g_free (iter_val); + continue; + } entry = g_new (ESummaryShownModelEntry, 1); entry->location = g_strdup (locdata[1]); -- cgit