QDateTime: add some const

For CoW types const methods will be called.
For QDate we can use new const getDate() method.

Change-Id: Ie3a4fe48b3635d270a79c9ac5205b835b3442eae
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
bb10
Anton Kudryavtsev 2016-04-07 15:09:00 +03:00
parent 307825ca63
commit 684c8d4d12
2 changed files with 2 additions and 2 deletions

View File

@ -4531,7 +4531,7 @@ QDateTime QDateTime::fromString(const QString& string, Qt::DateFormat format)
int second = 0;
int millisecond = 0;
if (timeParts.count() > 2) {
QVector<QStringRef> secondParts = timeParts.at(2).split(QLatin1Char('.'));
const QVector<QStringRef> secondParts = timeParts.at(2).split(QLatin1Char('.'));
if (secondParts.size() > 2) {
return QDateTime();
}

View File

@ -890,7 +890,7 @@ QDateTimeParser::StateNode QDateTimeParser::parse(QString &input, int &cursorPos
QDTPDEBUG << "parse" << input;
{
int year, month, day;
QDate currentDate = currentValue.date();
const QDate currentDate = currentValue.date();
const QTime currentTime = currentValue.time();
currentDate.getDate(&year, &month, &day);
int year2digits = year % 100;