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
parent
307825ca63
commit
684c8d4d12
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue