Commit 7c257f5c authored by Xuetian Weng's avatar Xuetian Weng

Fix saving date for timezone with negative offset

Check the '-' sign return from QTimeZone together with '+'.

REVIEW: 125215
BUG: 342789
FIXED-IN: 15.08.1
parent ed528a07
......@@ -307,7 +307,7 @@ void updateHeader(QString& header,
QString dateTimeString = QDateTime::currentDateTime().toString(QStringLiteral("yyyy-MM-dd hh:mm"));
QString zoneOffsetString1 = QTimeZone(QTimeZone::systemTimeZoneId()).displayName(QTimeZone::GenericTime, QTimeZone::OffsetName);
int zpos=qMax(0, zoneOffsetString1.indexOf('+'));
int zpos=qMax(qMax(0, zoneOffsetString1.indexOf('+')), zoneOffsetString1.indexOf('-'));
QString zoneOffsetString = QString::fromRawData(zoneOffsetString1.unicode()+zpos, zoneOffsetString1.length()-zpos);
temp=QStringLiteral("PO-Revision-Date: ")%dateTimeString%zoneOffsetString.remove(':')%QStringLiteral("\\n");
QRegExp poRevDate(QStringLiteral("^ *PO-Revision-Date:.*"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment