[gnome-control-center] region: Fix overeager string splitting
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] region: Fix overeager string splitting
- Date: Tue, 8 Feb 2011 22:34:12 +0000 (UTC)
commit 9e0d566cfb03a851564e589c885c4fba2205e3ae
Author: Bastien Nocera <hadess hadess net>
Date: Tue Feb 8 22:33:12 2011 +0000
region: Fix overeager string splitting
So that Argentinian timezones show up properly again.
panels/datetime/cc-datetime-panel.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/panels/datetime/cc-datetime-panel.c b/panels/datetime/cc-datetime-panel.c
index d980718..ce3ba39 100644
--- a/panels/datetime/cc-datetime-panel.c
+++ b/panels/datetime/cc-datetime-panel.c
@@ -512,6 +512,7 @@ get_regions (TzLocation *loc,
gchar *zone;
gchar **split;
gchar **split_translated;
+ gchar *translated_city;
zone = g_strdup (loc->zone);
g_strdelimit (zone, "_", ' ');
@@ -533,15 +534,19 @@ get_regions (TzLocation *loc,
REGION_COL_REGION_TRANSLATED, split_translated[0], -1);
}
+ /* g_regex_split_simple() splits too much for us, and would break
+ * America/Argentina/Buenos_Aires into 3 strings, so rejoin the city part */
+ translated_city = g_strjoinv ("/", split_translated + 1);
gtk_list_store_insert_with_values (data->city_store, NULL, 0,
CITY_COL_CITY, split[1],
- CITY_COL_CITY_TRANSLATED, split_translated[1],
+ CITY_COL_CITY_TRANSLATED, translated_city,
CITY_COL_REGION, split[0],
CITY_COL_REGION_TRANSLATED, split_translated[0],
CITY_COL_ZONE, loc->zone,
-1);
+ g_free (translated_city);
g_strfreev (split);
g_strfreev (split_translated);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]