QTimeZone - Fix finding Linux System Time Zone

Extract the correct length sub-string from the /etc/sysconfig/clock file

Change-Id: I37b4f625a51b172ed11ecefbd1b7dc562c5bb89d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
John Layt 2013-10-15 16:25:22 +02:00 committed by The Qt Project
parent 0a19ee0aea
commit 688b006cc8

View File

@ -883,9 +883,9 @@ QByteArray QTzTimeZonePrivate::systemTimeZoneId() const
while (olsenId.isEmpty() && !ts.atEnd() && ts.status() == QTextStream::Ok) {
line = ts.readLine();
if (line.left(5) == QStringLiteral("ZONE=")) {
olsenId = line.mid(6, line.size() - 2).toUtf8();
olsenId = line.mid(6, line.size() - 7).toUtf8();
} else if (line.left(9) == QStringLiteral("TIMEZONE=")) {
olsenId = line.mid(6, line.size() - 2).toUtf8();
olsenId = line.mid(10, line.size() - 11).toUtf8();
}
}
}