From: robertlipe Date: Mon, 28 Jan 2013 01:13:04 +0000 (+0000) Subject: Don't use QDateTime to parse XML times just yet. X-Git-Tag: archive/raspbian/1.10.0+ds-2+rpi1~1^2~12^2~11^2~688 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=955712846a169ecd688678f35a77adf1f5df7cc2;p=gpsbabel.git Don't use QDateTime to parse XML times just yet. --- diff --git a/gpsbabel/gpx.cc b/gpsbabel/gpx.cc index 10b83a78e..735d8bf08 100644 --- a/gpsbabel/gpx.cc +++ b/gpsbabel/gpx.cc @@ -855,27 +855,6 @@ gs_get_container(geocache_container t) time_t xml_parse_time(const char* cdatastr, int* microsecs) { -#if NEWTIME - time_t rv = 0; - QString string_date(cdatastr); - - // Lovely. It looks like the OSM format triggers Qt Bug 18290. by - // leaving it ambiguous whether DST is in effect, which triggers local - // time. Allegedly fixed in Qt 5.0, but trivial to work around. - // https://bugreports.qt-project.org/browse/QTBUG-18290 - if (string_date.endsWith("+00:00")) { - string_date.replace("+00:00", "Z"); - } - QDateTime dt(QDateTime::fromString(string_date, Qt::ISODate)); - - if (dt.isValid()) { - rv = dt.toTime_t(); - if (microsecs) { - *microsecs = dt.time().msec() * 1000; - } - } - return rv; -#else int off_hr = 0; int off_min = 0; int off_sign = 1; @@ -939,7 +918,6 @@ xml_parse_time(const char* cdatastr, int* microsecs) xfree(timestr); return rv; -#endif } static void