Merge lp:~ted/indicator-datetime/lp773987 into lp:indicator-datetime/0.4

Proposed by Ted Gould
Status: Merged
Approved by: Charles Kerr
Approved revision: 175
Merged at revision: 175
Proposed branch: lp:~ted/indicator-datetime/lp773987
Merge into: lp:indicator-datetime/0.4
Diff against target: 32 lines (+4/-4)
2 files modified
src/datetime-prefs-locations.c (+2/-2)
src/datetime-prefs.c (+2/-2)
To merge this branch: bzr merge lp:~ted/indicator-datetime/lp773987
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve
Sebastien Bacher Approve
Review via email: mp+102591@code.launchpad.net

Description of the change

Switch the parsing of the lat and long to be non-locale based as it's returned from the webservice in C, we want to parse it using the decimal instead of a comma.

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks, I can confirm that fixes the bug with "New York" in a french locale

review: Approve
Revision history for this message
Charles Kerr (charlesk) wrote :

Great catch, Ted!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/datetime-prefs-locations.c'
2--- src/datetime-prefs-locations.c 2012-03-20 22:35:24 +0000
3+++ src/datetime-prefs-locations.c 2012-04-18 21:24:19 +0000
4@@ -201,8 +201,8 @@
5 CC_TIMEZONE_COMPLETION_LONGITUDE, &strlon,
6 -1);
7
8- if (strlat && *strlat) lat = atof(strlat);
9- if (strlon && *strlon) lon = atof(strlon);
10+ if (strlat && *strlat) lat = g_ascii_strtod(strlat, NULL);
11+ if (strlon && *strlon) lon = g_ascii_strtod(strlon, NULL);
12
13 CcTimezoneMap * tzmap = CC_TIMEZONE_MAP (g_object_get_data (G_OBJECT (widget), "tzmap"));
14 g_free (zone);
15
16=== modified file 'src/datetime-prefs.c'
17--- src/datetime-prefs.c 2012-03-30 00:36:38 +0000
18+++ src/datetime-prefs.c 2012-04-18 21:24:19 +0000
19@@ -613,11 +613,11 @@
20 -1);
21
22 if (strlon != NULL && strlon[0] != 0) {
23- lon = strtod(strlon, NULL);
24+ lon = g_ascii_strtod(strlon, NULL);
25 }
26
27 if (strlat != NULL && strlat[0] != 0) {
28- lat = strtod(strlat, NULL);
29+ lat = g_ascii_strtod(strlat, NULL);
30 }
31
32 zone = cc_timezone_map_get_timezone_at_coords (self->priv->tzmap, lon, lat);

Subscribers

People subscribed via source and target branches