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
=== modified file 'src/datetime-prefs-locations.c'
--- src/datetime-prefs-locations.c 2012-03-20 22:35:24 +0000
+++ src/datetime-prefs-locations.c 2012-04-18 21:24:19 +0000
@@ -201,8 +201,8 @@
201 CC_TIMEZONE_COMPLETION_LONGITUDE, &strlon,201 CC_TIMEZONE_COMPLETION_LONGITUDE, &strlon,
202 -1);202 -1);
203203
204 if (strlat && *strlat) lat = atof(strlat);204 if (strlat && *strlat) lat = g_ascii_strtod(strlat, NULL);
205 if (strlon && *strlon) lon = atof(strlon);205 if (strlon && *strlon) lon = g_ascii_strtod(strlon, NULL);
206206
207 CcTimezoneMap * tzmap = CC_TIMEZONE_MAP (g_object_get_data (G_OBJECT (widget), "tzmap"));207 CcTimezoneMap * tzmap = CC_TIMEZONE_MAP (g_object_get_data (G_OBJECT (widget), "tzmap"));
208 g_free (zone);208 g_free (zone);
209209
=== modified file 'src/datetime-prefs.c'
--- src/datetime-prefs.c 2012-03-30 00:36:38 +0000
+++ src/datetime-prefs.c 2012-04-18 21:24:19 +0000
@@ -613,11 +613,11 @@
613 -1);613 -1);
614614
615 if (strlon != NULL && strlon[0] != 0) {615 if (strlon != NULL && strlon[0] != 0) {
616 lon = strtod(strlon, NULL);616 lon = g_ascii_strtod(strlon, NULL);
617 }617 }
618618
619 if (strlat != NULL && strlat[0] != 0) {619 if (strlat != NULL && strlat[0] != 0) {
620 lat = strtod(strlat, NULL);620 lat = g_ascii_strtod(strlat, NULL);
621 }621 }
622622
623 zone = cc_timezone_map_get_timezone_at_coords (self->priv->tzmap, lon, lat);623 zone = cc_timezone_map_get_timezone_at_coords (self->priv->tzmap, lon, lat);

Subscribers

People subscribed via source and target branches