diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2019-09-03 15:18:14 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2019-09-04 18:43:35 +0200 |
commit | 46ec24d2b9a0fb1d59955f11dab0ead05dd017f9 (patch) | |
tree | 552d32c9f7b8d447359771987f25a0fcfa15b764 /src/corelib/time/qdatetimeparser.cpp | |
parent | 978f579a8c6a6cff3803cc62d4b09c974f476285 (diff) |
Rename calendar methods from m{in,ax} to m{in,ax}imum
Words should not be abbreviated.
Split a long line and reflowed some comments in the process.
Fixes: QTBUG-78008
Change-Id: I52d75409f02e2cecbed3e94d424617ad594c275b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/corelib/time/qdatetimeparser.cpp')
-rw-r--r-- | src/corelib/time/qdatetimeparser.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/corelib/time/qdatetimeparser.cpp b/src/corelib/time/qdatetimeparser.cpp index d0f34358b9..2c566e3584 100644 --- a/src/corelib/time/qdatetimeparser.cpp +++ b/src/corelib/time/qdatetimeparser.cpp @@ -223,21 +223,23 @@ int QDateTimeParser::absoluteMax(int s, const QDateTime &cur) const case TimeZoneSection: return QTimeZone::MaxUtcOffsetSecs; #endif case Hour24Section: - case Hour12Section: return 23; // this is special-cased in - // parseSection. We want it to be - // 23 for the stepBy case. + case Hour12Section: + // This is special-cased in parseSection. + // We want it to be 23 for the stepBy case. + return 23; case MinuteSection: case SecondSection: return 59; case MSecSection: return 999; case YearSection2Digits: - case YearSection: return 9999; // sectionMaxSize will prevent - // people from typing in a larger - // number in count == 2 sections. - // stepBy() will work on real years anyway - case MonthSection: return calendar.maxMonthsInYear(); + case YearSection: + // sectionMaxSize will prevent people from typing in a larger number in + // count == 2 sections; stepBy() will work on real years anyway. + return 9999; + case MonthSection: return calendar.maximumMonthsInYear(); case DaySection: case DayOfWeekSectionShort: - case DayOfWeekSectionLong: return cur.isValid() ? cur.date().daysInMonth(calendar) : calendar.maxDaysInMonth() ; + case DayOfWeekSectionLong: + return cur.isValid() ? cur.date().daysInMonth(calendar) : calendar.maximumDaysInMonth(); case AmPmSection: return 1; default: break; } @@ -615,7 +617,7 @@ int QDateTimeParser::sectionSize(int sectionIndex) const int QDateTimeParser::sectionMaxSize(Section s, int count) const { #if QT_CONFIG(textdate) - int mcount = calendar.maxMonthsInYear(); + int mcount = calendar.maximumMonthsInYear(); #endif switch (s) { @@ -1291,9 +1293,9 @@ QDateTimeParser::scanString(const QDateTime &defaultValue, } if (!calendar.isDateValid(year, month, day)) { - if (day <= calendar.maxDaysInMonth()) + if (day <= calendar.maximumDaysInMonth()) cachedDay = day; - if (day > calendar.minDaysInMonth() && calendar.isDateValid(year, month, 1)) + if (day > calendar.minimumDaysInMonth() && calendar.isDateValid(year, month, 1)) needfixday = true; } if (needfixday) { |