From 4694a1b2aec35bf6eb1461e58a0cbee9ca94191a Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 8 Aug 2023 17:19:55 +0200 Subject: [PATCH] corelib/time/: clean out assorted over-namespacing QDate's constructor can see maxJd() and minJd() without namespace prefix. QDateTimeParser::SectionNode's name() inherits visibility from QDateTimeParser of its Section enum's members. Change-Id: I6315c4ede8875ef725d5b778eebac1e2027cd8b1 Reviewed-by: Marc Mutz --- src/corelib/time/qdatetime.cpp | 4 ++-- src/corelib/time/qdatetimeparser.cpp | 32 ++++++++++++++-------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/corelib/time/qdatetime.cpp b/src/corelib/time/qdatetime.cpp index cd4cdf7d5e8..20a3439f09c 100644 --- a/src/corelib/time/qdatetime.cpp +++ b/src/corelib/time/qdatetime.cpp @@ -435,8 +435,8 @@ static int fromOffsetString(QStringView offsetString, bool *valid) noexcept QDate::QDate(int y, int m, int d) { - static_assert(QDate::maxJd() == JulianDayMax); - static_assert(QDate::minJd() == JulianDayMin); + static_assert(maxJd() == JulianDayMax); + static_assert(minJd() == JulianDayMin); jd = QGregorianCalendar::julianFromParts(y, m, d).value_or(nullJd()); } diff --git a/src/corelib/time/qdatetimeparser.cpp b/src/corelib/time/qdatetimeparser.cpp index 64679810158..e7878a4958a 100644 --- a/src/corelib/time/qdatetimeparser.cpp +++ b/src/corelib/time/qdatetimeparser.cpp @@ -2165,22 +2165,22 @@ bool QDateTimeParser::skipToNextSection(int index, const QDateTime ¤t, QSt QString QDateTimeParser::SectionNode::name(QDateTimeParser::Section s) { switch (s) { - case QDateTimeParser::AmPmSection: return "AmPmSection"_L1; - case QDateTimeParser::DaySection: return "DaySection"_L1; - case QDateTimeParser::DayOfWeekSectionShort: return "DayOfWeekSectionShort"_L1; - case QDateTimeParser::DayOfWeekSectionLong: return "DayOfWeekSectionLong"_L1; - case QDateTimeParser::Hour24Section: return "Hour24Section"_L1; - case QDateTimeParser::Hour12Section: return "Hour12Section"_L1; - case QDateTimeParser::MSecSection: return "MSecSection"_L1; - case QDateTimeParser::MinuteSection: return "MinuteSection"_L1; - case QDateTimeParser::MonthSection: return "MonthSection"_L1; - case QDateTimeParser::SecondSection: return "SecondSection"_L1; - case QDateTimeParser::TimeZoneSection: return "TimeZoneSection"_L1; - case QDateTimeParser::YearSection: return "YearSection"_L1; - case QDateTimeParser::YearSection2Digits: return "YearSection2Digits"_L1; - case QDateTimeParser::NoSection: return "NoSection"_L1; - case QDateTimeParser::FirstSection: return "FirstSection"_L1; - case QDateTimeParser::LastSection: return "LastSection"_L1; + case AmPmSection: return "AmPmSection"_L1; + case DaySection: return "DaySection"_L1; + case DayOfWeekSectionShort: return "DayOfWeekSectionShort"_L1; + case DayOfWeekSectionLong: return "DayOfWeekSectionLong"_L1; + case Hour24Section: return "Hour24Section"_L1; + case Hour12Section: return "Hour12Section"_L1; + case MSecSection: return "MSecSection"_L1; + case MinuteSection: return "MinuteSection"_L1; + case MonthSection: return "MonthSection"_L1; + case SecondSection: return "SecondSection"_L1; + case TimeZoneSection: return "TimeZoneSection"_L1; + case YearSection: return "YearSection"_L1; + case YearSection2Digits: return "YearSection2Digits"_L1; + case NoSection: return "NoSection"_L1; + case FirstSection: return "FirstSection"_L1; + case LastSection: return "LastSection"_L1; default: return "Unknown section "_L1 + QString::number(int(s)); } }